further elimination of entity-based code; more simplification/moving to cfg; begin sketching out expanded eval-viz block tree, such that each block can have its own table topology (will be useful to collapse/simplify/expand the capabilities of watch views)

This commit is contained in:
Ryan Fleury
2025-01-22 09:22:06 -08:00
parent 84fd1e9d3f
commit 16a717d684
10 changed files with 327 additions and 2432 deletions
@@ -667,11 +667,31 @@ ev_resolved_from_expr(Arena *arena, E_Expr *expr, EV_ViewRuleList *view_rules)
return expr; return expr;
} }
////////////////////////////////
//~ rjf: Column List Building
internal EV_Col *
ev_col_list_push(Arena *arena, EV_ColList *list)
{
EV_Col *col = push_array(arena, EV_Col, 1);
SLLQueuePush(list->first, list->last, col);
list->count += 1;
return col;
}
internal EV_Col *
ev_col_list_push_new(Arena *arena, EV_ColList *list, String8 key)
{
EV_Col *col = ev_col_list_push(arena, list);
col->key = push_str8_copy(arena, key);
return col;
}
//////////////////////////////// ////////////////////////////////
//~ rjf: Block Building //~ rjf: Block Building
internal EV_BlockTree internal EV_BlockTree
ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 string, E_Expr *expr, EV_ViewRuleList *view_rules) ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 string, E_Expr *expr, EV_ViewRuleList *view_rules, EV_ColList *cols)
{ {
ProfBeginFunction(); ProfBeginFunction();
EV_BlockTree tree = {&ev_nil_block}; EV_BlockTree tree = {&ev_nil_block};
@@ -691,6 +711,7 @@ ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 str
tree.root = push_array(arena, EV_Block, 1); tree.root = push_array(arena, EV_Block, 1);
MemoryCopyStruct(tree.root, &ev_nil_block); MemoryCopyStruct(tree.root, &ev_nil_block);
tree.root->key = ev_key_root(); tree.root->key = ev_key_root();
tree.root->cols = *cols;
tree.root->string = string; tree.root->string = string;
tree.root->expr = ev_resolved_from_expr(arena, expr, top_level_view_rules); tree.root->expr = ev_resolved_from_expr(arena, expr, top_level_view_rules);
tree.root->view_rules = top_level_view_rules; tree.root->view_rules = top_level_view_rules;
@@ -758,6 +779,7 @@ ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 str
expansion_block->parent = t->parent_block; expansion_block->parent = t->parent_block;
expansion_block->key = key; expansion_block->key = key;
expansion_block->split_relative_idx = t->split_relative_idx; expansion_block->split_relative_idx = t->split_relative_idx;
expansion_block->cols = *cols;
expansion_block->expr = t->expr; expansion_block->expr = t->expr;
expansion_block->view_rules = t->view_rules; expansion_block->view_rules = t->view_rules;
expansion_block->expand_view_rule_info = expand_view_rule_info; expansion_block->expand_view_rule_info = expand_view_rule_info;
@@ -885,7 +907,7 @@ ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 str
} }
internal EV_BlockTree internal EV_BlockTree
ev_block_tree_from_string(Arena *arena, EV_View *view, String8 filter, String8 string, EV_ViewRuleList *view_rules) ev_block_tree_from_string(Arena *arena, EV_View *view, String8 filter, String8 string, EV_ViewRuleList *view_rules, EV_ColList *cols)
{ {
ProfBeginFunction(); ProfBeginFunction();
EV_BlockTree tree = {0}; EV_BlockTree tree = {0};
@@ -896,7 +918,7 @@ ev_block_tree_from_string(Arena *arena, EV_View *view, String8 filter, String8 s
EV_ViewRuleList *fastpath_view_rules = ev_view_rule_list_from_expr_fastpaths(arena, string); EV_ViewRuleList *fastpath_view_rules = ev_view_rule_list_from_expr_fastpaths(arena, string);
EV_ViewRuleList *all_view_rules = ev_view_rule_list_copy(arena, view_rules); EV_ViewRuleList *all_view_rules = ev_view_rule_list_copy(arena, view_rules);
ev_view_rule_list_concat_in_place(all_view_rules, &fastpath_view_rules); ev_view_rule_list_concat_in_place(all_view_rules, &fastpath_view_rules);
tree = ev_block_tree_from_expr(arena, view, filter, string, parse.expr, all_view_rules); tree = ev_block_tree_from_expr(arena, view, filter, string, parse.expr, all_view_rules, cols);
} }
scratch_end(scratch); scratch_end(scratch);
ProfEnd(); ProfEnd();
@@ -187,6 +187,24 @@ struct EV_ViewRuleInfoTable
U64 slots_count; U64 slots_count;
}; };
////////////////////////////////
//~ rjf: Columns
typedef struct EV_Col EV_Col;
struct EV_Col
{
EV_Col *next;
String8 key;
};
typedef struct EV_ColList EV_ColList;
struct EV_ColList
{
EV_Col *first;
EV_Col *last;
U64 count;
};
//////////////////////////////// ////////////////////////////////
//~ rjf: Blocks //~ rjf: Blocks
@@ -206,6 +224,9 @@ struct EV_Block
// rjf: split index, relative to parent's space // rjf: split index, relative to parent's space
U64 split_relative_idx; U64 split_relative_idx;
// rjf: columns
EV_ColList cols;
// rjf: expression / visualization info // rjf: expression / visualization info
String8 string; String8 string;
E_Expr *expr; E_Expr *expr;
@@ -351,7 +372,7 @@ global read_only EV_ViewRuleInfo ev_nil_view_rule_info =
thread_static EV_ViewRuleInfoTable *ev_view_rule_info_table = 0; thread_static EV_ViewRuleInfoTable *ev_view_rule_info_table = 0;
global read_only EV_ViewRuleList ev_nil_view_rule_list = {0}; global read_only EV_ViewRuleList ev_nil_view_rule_list = {0};
thread_static EV_AutoViewRuleTable *ev_auto_view_rule_table = 0; thread_static EV_AutoViewRuleTable *ev_auto_view_rule_table = 0;
global read_only EV_Block ev_nil_block = {&ev_nil_block, &ev_nil_block, &ev_nil_block, &ev_nil_block, &ev_nil_block, {0}, 0, {0}, &e_expr_nil, &ev_nil_view_rule_list, &ev_nil_view_rule_info}; global read_only EV_Block ev_nil_block = {&ev_nil_block, &ev_nil_block, &ev_nil_block, &ev_nil_block, &ev_nil_block, {0}, 0, {0}, {0}, &e_expr_nil, &ev_nil_view_rule_list, &ev_nil_view_rule_info};
//////////////////////////////// ////////////////////////////////
//~ rjf: Key Functions //~ rjf: Key Functions
@@ -415,11 +436,17 @@ internal void ev_view_rule_list_concat_in_place(EV_ViewRuleList *dst, EV_ViewRul
internal E_Expr *ev_resolved_from_expr(Arena *arena, E_Expr *expr, EV_ViewRuleList *view_rules); internal E_Expr *ev_resolved_from_expr(Arena *arena, E_Expr *expr, EV_ViewRuleList *view_rules);
////////////////////////////////
//~ rjf: Column List Building
internal EV_Col *ev_col_list_push(Arena *arena, EV_ColList *list);
internal EV_Col *ev_col_list_push_new(Arena *arena, EV_ColList *list, String8 key);
//////////////////////////////// ////////////////////////////////
//~ rjf: Block Building //~ rjf: Block Building
internal EV_BlockTree ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 string, E_Expr *expr, EV_ViewRuleList *view_rules); internal EV_BlockTree ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 string, E_Expr *expr, EV_ViewRuleList *view_rules, EV_ColList *cols);
internal EV_BlockTree ev_block_tree_from_string(Arena *arena, EV_View *view, String8 filter, String8 string, EV_ViewRuleList *view_rules); internal EV_BlockTree ev_block_tree_from_string(Arena *arena, EV_View *view, String8 filter, String8 string, EV_ViewRuleList *view_rules, EV_ColList *cols);
internal U64 ev_depth_from_block(EV_Block *block); internal U64 ev_depth_from_block(EV_Block *block);
//////////////////////////////// ////////////////////////////////
+3 -2
View File
@@ -715,9 +715,10 @@ os_w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
// of the top hit area so manually checking that. // of the top hit area so manually checking that.
F32 dpi = w32_GetDpiForWindow_func ? (F32)w32_GetDpiForWindow_func(hwnd) : 96.f; F32 dpi = w32_GetDpiForWindow_func ? (F32)w32_GetDpiForWindow_func(hwnd) : 96.f;
S32 frame_y = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CYFRAME, dpi) : GetSystemMetrics(SM_CYFRAME); S32 frame_y = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CYFRAME, dpi) : GetSystemMetrics(SM_CYFRAME);
S32 padding = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CXPADDEDBORDER, dpi) : GetSystemMetrics(SM_CXPADDEDBORDER); // NOTE(rjf): it seems incorrect to apply this padding here...
// S32 padding = w32_GetSystemMetricsForDpi_func ? w32_GetSystemMetricsForDpi_func(SM_CXPADDEDBORDER, dpi) : GetSystemMetrics(SM_CXPADDEDBORDER);
B32 is_over_top_resize = pos_client.y >= 0 && pos_client.y < frame_y + padding; B32 is_over_top_resize = pos_client.y >= 0 && pos_client.y < frame_y; // + padding;
B32 is_over_title_bar = pos_client.y >= 0 && pos_client.y < window->custom_border_title_thickness; B32 is_over_title_bar = pos_client.y >= 0 && pos_client.y < window->custom_border_title_thickness;
//- rjf: check against title bar client areas //- rjf: check against title bar client areas
+4 -10
View File
@@ -54,12 +54,12 @@ RD_VocabularyInfo rd_vocabulary_info_table[39] =
{str8_lit_comp("stdout_path"), str8_lit_comp("stdout_paths"), str8_lit_comp("Standard Output Path"), str8_lit_comp("Standard Output Paths"), RD_IconKind_Null}, {str8_lit_comp("stdout_path"), str8_lit_comp("stdout_paths"), str8_lit_comp("Standard Output Path"), str8_lit_comp("Standard Output Paths"), RD_IconKind_Null},
{str8_lit_comp("stderr_path"), str8_lit_comp("stderr_paths"), str8_lit_comp("Standard Error Path"), str8_lit_comp("Standard Error Paths"), RD_IconKind_Null}, {str8_lit_comp("stderr_path"), str8_lit_comp("stderr_paths"), str8_lit_comp("Standard Error Path"), str8_lit_comp("Standard Error Paths"), RD_IconKind_Null},
{str8_lit_comp("stdin_path"), str8_lit_comp("stdin_paths"), str8_lit_comp("Standard Input Path"), str8_lit_comp("Standard Input Paths"), RD_IconKind_Null}, {str8_lit_comp("stdin_path"), str8_lit_comp("stdin_paths"), str8_lit_comp("Standard Input Path"), str8_lit_comp("Standard Input Paths"), RD_IconKind_Null},
{str8_lit_comp("window"), str8_lit_comp("windows"), str8_lit_comp("Window"), str8_lit_comp("Windows"), RD_IconKind_Null}, {str8_lit_comp("window"), str8_lit_comp("windows"), str8_lit_comp("Window"), str8_lit_comp("Windows"), RD_IconKind_Window},
{str8_lit_comp("panel"), str8_lit_comp("panels"), str8_lit_comp("Panel"), str8_lit_comp("Panels"), RD_IconKind_Null}, {str8_lit_comp("panel"), str8_lit_comp("panels"), str8_lit_comp("Panel"), str8_lit_comp("Panels"), RD_IconKind_Null},
{str8_lit_comp("view"), str8_lit_comp("views"), str8_lit_comp("View"), str8_lit_comp("Views"), RD_IconKind_Null}, {str8_lit_comp("view"), str8_lit_comp("views"), str8_lit_comp("View"), str8_lit_comp("Views"), RD_IconKind_Null},
{str8_lit_comp("tab"), str8_lit_comp("tabs"), str8_lit_comp("Tab"), str8_lit_comp("Tabs"), RD_IconKind_Null}, {str8_lit_comp("tab"), str8_lit_comp("tabs"), str8_lit_comp("Tab"), str8_lit_comp("Tabs"), RD_IconKind_Null},
{str8_lit_comp("recent_project"), str8_lit_comp("recent_projects"), str8_lit_comp("Recent Project"), str8_lit_comp("Recent Projects"), RD_IconKind_Null}, {str8_lit_comp("recent_project"), str8_lit_comp("recent_projects"), str8_lit_comp("Recent Project"), str8_lit_comp("Recent Projects"), RD_IconKind_Briefcase},
{str8_lit_comp("recent_file"), str8_lit_comp("recent_files"), str8_lit_comp("Recent File"), str8_lit_comp("Recent Files"), RD_IconKind_Null}, {str8_lit_comp("recent_file"), str8_lit_comp("recent_files"), str8_lit_comp("Recent File"), str8_lit_comp("Recent Files"), RD_IconKind_FileOutline},
{str8_lit_comp("src"), str8_lit_comp("srcs"), str8_lit_comp("Source"), str8_lit_comp("Sources"), RD_IconKind_Null}, {str8_lit_comp("src"), str8_lit_comp("srcs"), str8_lit_comp("Source"), str8_lit_comp("Sources"), RD_IconKind_Null},
{str8_lit_comp("dst"), str8_lit_comp("dsts"), str8_lit_comp("Destination"), str8_lit_comp("Destinations"), RD_IconKind_Null}, {str8_lit_comp("dst"), str8_lit_comp("dsts"), str8_lit_comp("Destination"), str8_lit_comp("Destinations"), RD_IconKind_Null},
{str8_lit_comp("conversion_task"), str8_lit_comp("conversion_tasks"), str8_lit_comp("Conversion Task"), str8_lit_comp("Conversion Tasks"), RD_IconKind_Null}, {str8_lit_comp("conversion_task"), str8_lit_comp("conversion_tasks"), str8_lit_comp("Conversion Task"), str8_lit_comp("Conversion Tasks"), RD_IconKind_Null},
@@ -863,7 +863,7 @@ EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(types),
EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(procedures), EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_NAME(procedures),
}; };
RD_ViewRuleInfo rd_view_rule_kind_info_table[35] = RD_ViewRuleInfo rd_view_rule_kind_info_table[29] =
{ {
{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(null)}, {{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(null)},
{str8_lit_comp("empty"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(empty)}, {str8_lit_comp("empty"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(empty)},
@@ -871,12 +871,6 @@ RD_ViewRuleInfo rd_view_rule_kind_info_table[35] =
{str8_lit_comp("exception_filters"), str8_lit_comp("An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time."), str8_lit_comp("Exception Filters"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(exception_filters)}, {str8_lit_comp("exception_filters"), str8_lit_comp("An interface which controls whether or not the debugger will halt attached processes upon encountering specific exception codes for the first time."), str8_lit_comp("Exception Filters"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(exception_filters)},
{str8_lit_comp("settings"), str8_lit_comp("An interface to modify general settings for the debugger's appearance and behavior."), str8_lit_comp("Settings"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(settings)}, {str8_lit_comp("settings"), str8_lit_comp("An interface to modify general settings for the debugger's appearance and behavior."), str8_lit_comp("Settings"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(settings)},
{str8_lit_comp("pending_file"), str8_lit_comp(""), str8_lit_comp("Pending File"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(pending_file)}, {str8_lit_comp("pending_file"), str8_lit_comp(""), str8_lit_comp("Pending File"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(pending_file)},
{str8_lit_comp("commands"), str8_lit_comp(""), str8_lit_comp("Commands"), str8_lit_comp(""), RD_IconKind_List, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(commands)},
{str8_lit_comp("file_system"), str8_lit_comp(""), str8_lit_comp("File System"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(file_system)},
{str8_lit_comp("system_processes"), str8_lit_comp(""), str8_lit_comp("System Processes"), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(system_processes)},
{str8_lit_comp("entity_lister"), str8_lit_comp(""), str8_lit_comp("Entities"), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(entity_lister)},
{str8_lit_comp("ctrl_entity_lister"), str8_lit_comp(""), str8_lit_comp("Control Entities"), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(ctrl_entity_lister)},
{str8_lit_comp("symbol_lister"), str8_lit_comp(""), str8_lit_comp("Symbols"), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(symbol_lister)},
{str8_lit_comp("watch"), str8_lit_comp("The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section."), str8_lit_comp("Watch"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(watch)}, {str8_lit_comp("watch"), str8_lit_comp("The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section."), str8_lit_comp("Watch"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(watch)},
{str8_lit_comp("locals"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Locals"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(locals)}, {str8_lit_comp("locals"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Locals"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(locals)},
{str8_lit_comp("registers"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Registers"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(registers)}, {str8_lit_comp("registers"), str8_lit_comp("Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table."), str8_lit_comp("Registers"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(registers)},
+9 -21
View File
@@ -252,14 +252,14 @@ RD_CmdKind_ToggleWatchExpressionAtMouse,
RD_CmdKind_SetColumns, RD_CmdKind_SetColumns,
RD_CmdKind_ToggleAddressVisibility, RD_CmdKind_ToggleAddressVisibility,
RD_CmdKind_ToggleCodeBytesVisibility, RD_CmdKind_ToggleCodeBytesVisibility,
RD_CmdKind_EnableEntity, RD_CmdKind_EnableCfg,
RD_CmdKind_DisableEntity, RD_CmdKind_DisableCfg,
RD_CmdKind_SelectEntity, RD_CmdKind_SelectCfg,
RD_CmdKind_RemoveEntity, RD_CmdKind_RemoveCfg,
RD_CmdKind_NameEntity, RD_CmdKind_NameCfg,
RD_CmdKind_ConditionEntity, RD_CmdKind_ConditionCfg,
RD_CmdKind_DuplicateEntity, RD_CmdKind_DuplicateCfg,
RD_CmdKind_RelocateEntity, RD_CmdKind_RelocateCfg,
RD_CmdKind_AddBreakpoint, RD_CmdKind_AddBreakpoint,
RD_CmdKind_AddAddressBreakpoint, RD_CmdKind_AddAddressBreakpoint,
RD_CmdKind_AddFunctionBreakpoint, RD_CmdKind_AddFunctionBreakpoint,
@@ -395,12 +395,6 @@ RD_ViewRuleKind_GettingStarted,
RD_ViewRuleKind_ExceptionFilters, RD_ViewRuleKind_ExceptionFilters,
RD_ViewRuleKind_Settings, RD_ViewRuleKind_Settings,
RD_ViewRuleKind_PendingFile, RD_ViewRuleKind_PendingFile,
RD_ViewRuleKind_Commands,
RD_ViewRuleKind_FileSystem,
RD_ViewRuleKind_SystemProcesses,
RD_ViewRuleKind_EntityLister,
RD_ViewRuleKind_CtrlEntityLister,
RD_ViewRuleKind_SymbolLister,
RD_ViewRuleKind_Watch, RD_ViewRuleKind_Watch,
RD_ViewRuleKind_Locals, RD_ViewRuleKind_Locals,
RD_ViewRuleKind_Registers, RD_ViewRuleKind_Registers,
@@ -757,12 +751,6 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started);
RD_VIEW_RULE_UI_FUNCTION_DEF(exception_filters); RD_VIEW_RULE_UI_FUNCTION_DEF(exception_filters);
RD_VIEW_RULE_UI_FUNCTION_DEF(settings); RD_VIEW_RULE_UI_FUNCTION_DEF(settings);
RD_VIEW_RULE_UI_FUNCTION_DEF(pending_file); RD_VIEW_RULE_UI_FUNCTION_DEF(pending_file);
RD_VIEW_RULE_UI_FUNCTION_DEF(commands);
RD_VIEW_RULE_UI_FUNCTION_DEF(file_system);
RD_VIEW_RULE_UI_FUNCTION_DEF(system_processes);
RD_VIEW_RULE_UI_FUNCTION_DEF(entity_lister);
RD_VIEW_RULE_UI_FUNCTION_DEF(ctrl_entity_lister);
RD_VIEW_RULE_UI_FUNCTION_DEF(symbol_lister);
RD_VIEW_RULE_UI_FUNCTION_DEF(watch); RD_VIEW_RULE_UI_FUNCTION_DEF(watch);
RD_VIEW_RULE_UI_FUNCTION_DEF(locals); RD_VIEW_RULE_UI_FUNCTION_DEF(locals);
RD_VIEW_RULE_UI_FUNCTION_DEF(registers); RD_VIEW_RULE_UI_FUNCTION_DEF(registers);
@@ -809,7 +797,7 @@ extern EV_ViewRuleExprExpandInfoHookFunctionType * rd_collection_expr_expand_inf
extern EV_ViewRuleExprExpandRangeInfoHookFunctionType * rd_collection_expr_expand_range_info_hook_function_table[18]; extern EV_ViewRuleExprExpandRangeInfoHookFunctionType * rd_collection_expr_expand_range_info_hook_function_table[18];
extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_id_from_num_hook_function_table[18]; extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_id_from_num_hook_function_table[18];
extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_num_from_id_hook_function_table[18]; extern EV_ViewRuleExprExpandIDFromNumHookFunctionType * rd_collection_expr_expand_num_from_id_hook_function_table[18];
extern RD_ViewRuleInfo rd_view_rule_kind_info_table[35]; extern RD_ViewRuleInfo rd_view_rule_kind_info_table[29];
extern RD_IconKind rd_entity_kind_icon_kind_table[27]; extern RD_IconKind rd_entity_kind_icon_kind_table[27];
extern String8 rd_theme_preset_display_string_table[9]; extern String8 rd_theme_preset_display_string_table[9];
extern String8 rd_theme_preset_code_string_table[9]; extern String8 rd_theme_preset_code_string_table[9];
+12 -20
View File
@@ -72,12 +72,12 @@ RD_VocabularyMap:
{stdout_path _ "Standard Output Path" _ Null } {stdout_path _ "Standard Output Path" _ Null }
{stderr_path _ "Standard Error Path" _ Null } {stderr_path _ "Standard Error Path" _ Null }
{stdin_path _ "Standard Input Path" _ Null } {stdin_path _ "Standard Input Path" _ Null }
{window _ "Window" _ Null } {window _ "Window" _ Window }
{panel _ "Panel" _ Null } {panel _ "Panel" _ Null }
{view _ "View" _ Null } {view _ "View" _ Null }
{tab _ "Tab" _ Null } {tab _ "Tab" _ Null }
{recent_project _ "Recent Project" _ Null } {recent_project _ "Recent Project" _ Briefcase }
{recent_file _ "Recent File" _ Null } {recent_file _ "Recent File" _ FileOutline }
{src _ "Source" _ Null } {src _ "Source" _ Null }
{dst _ "Destination" _ Null } {dst _ "Destination" _ Null }
{conversion_task _ "Conversion Task" _ Null } {conversion_task _ "Conversion Task" _ Null }
@@ -478,15 +478,15 @@ RD_CmdTable: // | | | |
{ToggleAddressVisibility 1 1 Null null Nil Null 0 0 0 0 0 0 Thumbnails "toggle_address_visibility" "Toggle Address Visibility" "Toggles the visibility of addresses in a disassembly view." "" "$disasm," } {ToggleAddressVisibility 1 1 Null null Nil Null 0 0 0 0 0 0 Thumbnails "toggle_address_visibility" "Toggle Address Visibility" "Toggles the visibility of addresses in a disassembly view." "" "$disasm," }
{ToggleCodeBytesVisibility 1 1 Null null Nil Null 0 0 0 0 0 0 Thumbnails "toggle_code_bytes_visibility""Toggle Code Bytes Visibility" "Toggles the visibility of machine code bytes in a disassembly view." "" "$disasm," } {ToggleCodeBytesVisibility 1 1 Null null Nil Null 0 0 0 0 0 0 Thumbnails "toggle_code_bytes_visibility""Toggle Code Bytes Visibility" "Toggles the visibility of machine code bytes in a disassembly view." "" "$disasm," }
//- rjf: general entity operations //- rjf: general config operations
{EnableEntity 0 0 Null null Nil Null 0 0 0 0 0 0 Null "enable_entity" "Enable Entity" "Enables an entity." "" "" } {EnableCfg 0 0 Null null Nil Null 0 0 0 0 0 0 Null "enable_entity" "Enable Entity" "Enables an entity." "" "" }
{DisableEntity 0 0 Null null Nil Null 0 0 0 0 0 0 Null "disable_entity" "Disable Entity" "Disables an entity." "" "" } {DisableCfg 0 0 Null null Nil Null 0 0 0 0 0 0 Null "disable_entity" "Disable Entity" "Disables an entity." "" "" }
{SelectEntity 0 0 Null null Nil Null 0 0 0 0 0 0 CheckHollow "select_entity" "Select Entity" "Selects an entity, disabling all others of the same kind." "" "" } {SelectCfg 0 0 Null null Nil Null 0 0 0 0 0 0 CheckHollow "select_entity" "Select Entity" "Selects an entity, disabling all others of the same kind." "" "" }
{RemoveEntity 0 0 Null null Nil Null 0 0 0 0 0 0 Trash "remove_entity" "Remove Entity" "Removes an entity." "" "" } {RemoveCfg 0 0 Null null Nil Null 0 0 0 0 0 0 Trash "remove_entity" "Remove Entity" "Removes an entity." "" "" }
{NameEntity 0 0 Null null Nil Null 0 0 0 0 0 0 Null "name_entity" "Name Entity" "Equips an entity with a name." "" "" } {NameCfg 0 0 Null null Nil Null 0 0 0 0 0 0 Null "name_entity" "Name Entity" "Equips an entity with a name." "" "" }
{ConditionEntity 0 0 Null null Nil Null 0 0 0 0 0 0 Null "condition_entity" "Condition Entity" "Equips an entity with a condition string." "" "" } {ConditionCfg 0 0 Null null Nil Null 0 0 0 0 0 0 Null "condition_entity" "Condition Entity" "Equips an entity with a condition string." "" "" }
{DuplicateEntity 0 0 Null null Nil Null 0 0 0 0 0 0 Null "duplicate_entity" "Duplicate Entity" "Duplicates an entity." "" "" } {DuplicateCfg 0 0 Null null Nil Null 0 0 0 0 0 0 Null "duplicate_entity" "Duplicate Entity" "Duplicates an entity." "" "" }
{RelocateEntity 0 0 Null null Nil Null 0 0 0 0 0 0 Null "relocate_entity" "Relocate Entity" "Relocates an entity." "" "" } {RelocateCfg 0 0 Null null Nil Null 0 0 0 0 0 0 Null "relocate_entity" "Relocate Entity" "Relocates an entity." "" "" }
//- rjf: breakpoints //- rjf: breakpoints
{AddBreakpoint 1 1 Null null Nil Null 0 0 0 0 0 0 CircleFilled "add_breakpoint" "Add Breakpoint" "Places a breakpoint at a given location (file path and line number, address, or symbol name)." "" "" } {AddBreakpoint 1 1 Null null Nil Null 0 0 0 0 0 0 CircleFilled "add_breakpoint" "Add Breakpoint" "Places a breakpoint at a given location (file path and line number, address, or symbol name)." "" "" }
@@ -980,14 +980,6 @@ RD_ViewRuleTable:
//- rjf: temporary view for loading files - must analyze file before picking viewer //- rjf: temporary view for loading files - must analyze file before picking viewer
{ PendingFile pending_file "Pending File" "" FileOutline 0 0 0 0 0 0 0 "" } { PendingFile pending_file "Pending File" "" FileOutline 0 0 0 0 0 0 0 "" }
//- rjf: query listers
{ Commands commands "Commands" "" List 0 0 0 0 0 0 0 "" }
{ FileSystem file_system "File System" "" FileOutline 0 0 0 0 0 0 0 "" }
{ SystemProcesses system_processes "System Processes" "" Null 0 0 0 0 0 0 0 "" }
{ EntityLister entity_lister "Entities" "" Null 0 0 0 0 0 0 0 "" }
{ CtrlEntityLister ctrl_entity_lister "Control Entities" "" Null 0 0 0 0 0 0 0 "" }
{ SymbolLister symbol_lister "Symbols" "" Null 0 0 0 0 0 0 0 "" }
//- rjf: watch or watch-style tables //- rjf: watch or watch-style tables
{ Watch watch "Watch" "" Binoculars 1 1 1 0 0 0 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." } { Watch watch "Watch" "" Binoculars 1 1 1 0 0 0 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." }
{ Locals locals "Locals" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." } { Locals locals "Locals" "" Binoculars 1 1 1 0 0 0 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
+129 -463
View File
@@ -579,6 +579,16 @@ rd_cfg_release(RD_Cfg *cfg)
scratch_end(scratch); scratch_end(scratch);
} }
internal void
rd_cfg_release_all_children(RD_Cfg *cfg)
{
for(RD_Cfg *child = cfg->first, *next = &rd_nil_cfg; child != &rd_nil_cfg; child = next)
{
next = child->next;
rd_cfg_release(child);
}
}
internal RD_Handle internal RD_Handle
rd_handle_from_cfg(RD_Cfg *cfg) rd_handle_from_cfg(RD_Cfg *cfg)
{ {
@@ -1294,38 +1304,7 @@ rd_title_fstrs_from_cfg(Arena *arena, RD_Cfg *cfg, Vec4F32 secondary_color, F32
{ {
rgba = ui_top_palette()->text; rgba = ui_top_palette()->text;
} }
RD_IconKind icon_kind = rd_icon_kind_from_code_name(cfg->string);
//- rjf: name -> icon table
local_persist struct
{
String8 name;
RD_IconKind icon_kind;
}
name2icon_map[] =
{
{str8_lit_comp("target"), RD_IconKind_Target},
{str8_lit_comp("breakpoint"), RD_IconKind_CircleFilled},
{str8_lit_comp("auto_view_rule"), RD_IconKind_Binoculars},
{str8_lit_comp("file_path_map"), RD_IconKind_FileOutline},
{str8_lit_comp("watch_pin"), RD_IconKind_Pin},
{str8_lit_comp("watch"), RD_IconKind_Binoculars},
{str8_lit_comp("window"), RD_IconKind_Window},
{str8_lit_comp("recent_project"), RD_IconKind_Briefcase},
{str8_lit_comp("recent_file"), RD_IconKind_FileOutline},
};
//- rjf: map cfg -> icon
RD_IconKind icon_kind = RD_IconKind_Null;
for EachElement(idx, name2icon_map)
{
if(str8_match(cfg->string, name2icon_map[idx].name, 0))
{
icon_kind = name2icon_map[idx].icon_kind;
break;
}
}
//- rjf: map icon -> is-from-command-line
B32 is_from_command_line = 0; B32 is_from_command_line = 0;
{ {
RD_Cfg *cmd_line_root = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("command_line")); RD_Cfg *cmd_line_root = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("command_line"));
@@ -1947,28 +1926,6 @@ rd_entity_from_name_and_kind(String8 string, RD_EntityKind kind)
//////////////////////////////// ////////////////////////////////
//~ rjf: Frontend Entity Info Extraction //~ rjf: Frontend Entity Info Extraction
internal D_Target
rd_d_target_from_entity(RD_Entity *entity)
{
RD_Entity *src_target_exe = rd_entity_child_from_kind(entity, RD_EntityKind_Executable);
RD_Entity *src_target_args = rd_entity_child_from_kind(entity, RD_EntityKind_Arguments);
RD_Entity *src_target_wdir = rd_entity_child_from_kind(entity, RD_EntityKind_WorkingDirectory);
RD_Entity *src_target_stdo = rd_entity_child_from_kind(entity, RD_EntityKind_StdoutPath);
RD_Entity *src_target_stde = rd_entity_child_from_kind(entity, RD_EntityKind_StderrPath);
RD_Entity *src_target_stdi = rd_entity_child_from_kind(entity, RD_EntityKind_StdinPath);
RD_Entity *src_target_entry = rd_entity_child_from_kind(entity, RD_EntityKind_EntryPoint);
D_Target target = {0};
target.exe = src_target_exe->string;
target.args = src_target_args->string;
target.working_directory = src_target_wdir->string;
target.custom_entry_point_name = src_target_entry->string;
target.stdout_path = src_target_stdo->string;
target.stderr_path = src_target_stde->string;
target.stdin_path = src_target_stdi->string;
target.debug_subprocesses = entity->debug_subprocesses;
return target;
}
internal DR_FancyStringList internal DR_FancyStringList
rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_color, F32 size) rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_color, F32 size)
{ {
@@ -3290,11 +3247,7 @@ rd_store_view_expr_string(String8 string)
{ {
RD_Cfg *view = rd_cfg_from_handle(rd_regs()->view); RD_Cfg *view = rd_cfg_from_handle(rd_regs()->view);
RD_Cfg *expr = rd_cfg_child_from_string_or_alloc(view, str8_lit("expression")); RD_Cfg *expr = rd_cfg_child_from_string_or_alloc(view, str8_lit("expression"));
for(RD_Cfg *child = expr->first, *next = &rd_nil_cfg; child != &rd_nil_cfg; child = next) rd_cfg_release_all_children(expr);
{
next = child->next;
rd_cfg_release(child);
}
rd_cfg_new(expr, string); rd_cfg_new(expr, string);
} }
@@ -3303,11 +3256,7 @@ rd_store_view_filter(String8 string)
{ {
RD_Cfg *view = rd_cfg_from_handle(rd_regs()->view); RD_Cfg *view = rd_cfg_from_handle(rd_regs()->view);
RD_Cfg *filter = rd_cfg_child_from_string_or_alloc(view, str8_lit("filter")); RD_Cfg *filter = rd_cfg_child_from_string_or_alloc(view, str8_lit("filter"));
for(RD_Cfg *child = filter->first, *next = &rd_nil_cfg; child != &rd_nil_cfg; child = next) rd_cfg_release_all_children(filter);
{
next = child->next;
rd_cfg_release(child);
}
rd_cfg_new(filter, string); rd_cfg_new(filter, string);
} }
@@ -3334,13 +3283,7 @@ rd_store_view_param(String8 key, String8 value)
{ {
RD_Cfg *view = rd_cfg_from_handle(rd_regs()->view); RD_Cfg *view = rd_cfg_from_handle(rd_regs()->view);
RD_Cfg *child = rd_cfg_child_from_string_or_alloc(view, key); RD_Cfg *child = rd_cfg_child_from_string_or_alloc(view, key);
for(RD_Cfg *val_child = child->first, *next = &rd_nil_cfg; rd_cfg_release_all_children(child);
val_child != &rd_nil_cfg;
val_child = next)
{
next = val_child->next;
rd_cfg_release(val_child);
}
rd_cfg_new(child, value); rd_cfg_new(child, value);
} }
@@ -5236,71 +5179,6 @@ rd_window_frame(void)
} }
#endif #endif
}break; }break;
//////////////////////
//- rjf: frontend entities
//
case RD_RegSlot_Entity:
{
RD_Entity *entity = rd_entity_from_handle(regs->entity);
RD_EntityKindFlags kind_flags = rd_entity_kind_flags_table[entity->kind];
//- rjf: title
UI_Row
UI_PrefWidth(ui_text_dim(5, 1))
UI_TextAlignment(UI_TextAlign_Center)
UI_TextPadding(ui_top_font_size()*1.5f)
{
DR_FancyStringList fstrs = rd_title_fstrs_from_entity(scratch.arena, entity, ui_top_palette()->text_weak, ui_top_font_size());
UI_Box *title_box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
ui_box_equip_display_fancy_strings(title_box, &fstrs);
if(ctrl_entity->kind == CTRL_EntityKind_Thread)
{
ui_spacer(ui_em(0.5f, 1.f));
UI_FontSize(ui_top_font_size() - 1.f)
UI_CornerRadius(ui_top_font_size()*0.5f)
RD_Palette(RD_PaletteCode_NeutralPopButton)
UI_TextPadding(ui_top_font_size()*0.5f)
{
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak|UI_BoxFlag_DrawBorder) ui_label(string_from_arch(ctrl_entity->arch));
ui_spacer(ui_em(0.5f, 1.f));
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak|UI_BoxFlag_DrawBorder) ui_labelf("TID: %i", (U32)ctrl_entity->id);
}
}
}
RD_Palette(RD_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f));
//- rjf: name editor
if(kind_flags & RD_EntityKindFlag_CanRename) RD_Font(RD_FontSlot_Code) UI_TextPadding(ui_top_font_size()*1.5f)
{
UI_Signal sig = rd_line_editf(RD_LineEditFlag_Border|RD_LineEditFlag_CodeContents, 0, 0, &ws->ctx_menu_input_cursor, &ws->ctx_menu_input_mark, ws->ctx_menu_input_buffer, ws->ctx_menu_input_buffer_size, &ws->ctx_menu_input_string_size, 0, entity->string, "Name###entity_string_edit_%p", ctrl_entity);
if(ui_committed(sig))
{
rd_cmd(RD_CmdKind_NameEntity, .entity = regs->entity, .string = str8(ws->ctx_menu_input_buffer, ws->ctx_menu_input_string_size));
}
}
//- rjf: condition editor
if(kind_flags & RD_EntityKindFlag_CanCondition) RD_Font(RD_FontSlot_Code) UI_TextPadding(ui_top_font_size()*1.5f)
{
UI_Signal sig = rd_line_editf(RD_LineEditFlag_Border|RD_LineEditFlag_CodeContents, 0, 0, &ws->ctx_menu_input_cursor, &ws->ctx_menu_input_mark, ws->ctx_menu_input_buffer, ws->ctx_menu_input_buffer_size, &ws->ctx_menu_input_string_size, 0, rd_entity_child_from_kind(entity, RD_EntityKind_Condition)->string, "Condition###entity_condition_edit_%p", entity);
if(ui_committed(sig))
{
rd_cmd(RD_CmdKind_ConditionEntity, .entity = regs->entity, .string = str8(ws->ctx_menu_input_buffer, ws->ctx_menu_input_string_size));
}
}
//- rjf: name editor
if(entity->cfg_src == RD_CfgSrc_CommandLine)
{
if(ui_clicked(rd_icon_buttonf(RD_IconKind_Save, 0, "Save To Project")))
{
rd_entity_equip_cfg_src(entity, RD_CfgSrc_Project);
}
}
}break;
} }
} }
@@ -5839,13 +5717,14 @@ rd_window_frame(void)
RD_Palette(RD_PaletteCode_NeutralPopButton) RD_Palette(RD_PaletteCode_NeutralPopButton)
{ {
Temp scratch = scratch_begin(0, 0); Temp scratch = scratch_begin(0, 0);
RD_EntityList tasks = rd_query_cached_entity_list_with_kind(RD_EntityKind_ConversionTask); RD_CfgList tasks = rd_cfg_top_level_list_from_string(scratch.arena, str8_lit("conversion_task"));
for(RD_EntityNode *n = tasks.first; n != 0; n = n->next) for(RD_CfgNode *n = tasks.first; n != 0; n = n->next)
{ {
RD_Entity *task = n->entity; RD_Cfg *task = n->v;
if(task->alloc_time_us + 500000 < os_now_microseconds()) F32 task_t = ui_anim(ui_key_from_stringf(ui_key_zero(), "task_anim_%p_%I64u", task, task->gen), 1.f);
if(task_t > 0.5f)
{ {
String8 rdi_path = task->string; String8 rdi_path = task->first->string;
String8 rdi_name = str8_skip_last_slash(rdi_path); String8 rdi_name = str8_skip_last_slash(rdi_path);
String8 task_text = push_str8f(scratch.arena, "Creating %S...", rdi_name); String8 task_text = push_str8f(scratch.arena, "Creating %S...", rdi_name);
UI_Key key = ui_key_from_stringf(ui_key_zero(), "task_%p", task); UI_Key key = ui_key_from_stringf(ui_key_zero(), "task_%p", task);
@@ -6397,6 +6276,7 @@ rd_window_frame(void)
String8 expr = ws->hover_eval_string; String8 expr = ws->hover_eval_string;
E_Eval eval = e_eval_from_string(scratch.arena, expr); E_Eval eval = e_eval_from_string(scratch.arena, expr);
EV_ViewRuleList top_level_view_rules = {0}; EV_ViewRuleList top_level_view_rules = {0};
EV_ColList top_level_cols = {0};
//- rjf: build if good //- rjf: build if good
if(!e_type_key_match(eval.type_key, e_type_key_zero()) && !ui_any_ctx_menu_is_open()) if(!e_type_key_match(eval.type_key, e_type_key_zero()) && !ui_any_ctx_menu_is_open())
@@ -6410,7 +6290,7 @@ rd_window_frame(void)
EV_View *ev_view = rd_ev_view_from_key(d_hash_from_string(ev_view_key_string)); EV_View *ev_view = rd_ev_view_from_key(d_hash_from_string(ev_view_key_string));
EV_Key parent_key = ev_key_make(5381, 1); EV_Key parent_key = ev_key_make(5381, 1);
EV_Key key = ev_key_make(ev_hash_from_key(parent_key), 1); EV_Key key = ev_key_make(ev_hash_from_key(parent_key), 1);
EV_BlockTree block_tree = ev_block_tree_from_string(scratch.arena, ev_view, str8_zero(), expr, &top_level_view_rules); EV_BlockTree block_tree = ev_block_tree_from_string(scratch.arena, ev_view, str8_zero(), expr, &top_level_view_rules, &top_level_cols);
EV_BlockRangeList block_ranges = ev_block_range_list_from_tree(scratch.arena, &block_tree); EV_BlockRangeList block_ranges = ev_block_range_list_from_tree(scratch.arena, &block_tree);
// EV_BlockList viz_blocks = ev_block_list_from_view_expr_keys(scratch.arena, ev_view, str8_zero(), &top_level_view_rules, expr, parent_key, key, 0); // EV_BlockList viz_blocks = ev_block_list_from_view_expr_keys(scratch.arena, ev_view, str8_zero(), &top_level_view_rules, expr, parent_key, key, 0);
CTRL_Entity *entity = rd_ctrl_entity_from_eval_space(eval.space); CTRL_Entity *entity = rd_ctrl_entity_from_eval_space(eval.space);
@@ -12839,14 +12719,12 @@ rd_frame(void)
{ {
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, collection_type_keys[idx], rd_collection_name_table[idx], 1); ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, collection_type_keys[idx], rd_collection_name_table[idx], 1);
} }
RD_EntityList auto_view_rules = rd_query_cached_entity_list_with_kind(RD_EntityKind_AutoViewRule); RD_CfgList auto_view_rules = rd_cfg_top_level_list_from_string(scratch.arena, str8_lit("auto_view_rule"));
for(RD_EntityNode *n = auto_view_rules.first; n != 0; n = n->next) for(RD_CfgNode *n = auto_view_rules.first; n != 0; n = n->next)
{ {
RD_Entity *rule = n->entity; RD_Cfg *rule = n->v;
RD_Entity *src = rd_entity_child_from_kind(rule, RD_EntityKind_Source); String8 type_string = rd_cfg_child_from_string(rule, str8_lit("source"))->first->string;
RD_Entity *dst = rd_entity_child_from_kind(rule, RD_EntityKind_Dest); String8 view_rule_string = rd_cfg_child_from_string(rule, str8_lit("dest"))->first->string;
String8 type_string = src->string;
String8 view_rule_string = dst->string;
E_TokenArray tokens = e_token_array_from_text(scratch.arena, type_string); E_TokenArray tokens = e_token_array_from_text(scratch.arena, type_string);
E_Parse type_parse = e_parse_type_from_text_tokens(scratch.arena, type_string, &tokens); E_Parse type_parse = e_parse_type_from_text_tokens(scratch.arena, type_string, &tokens);
E_TypeKey type_key = e_type_from_expr(type_parse.expr); E_TypeKey type_key = e_type_from_expr(type_parse.expr);
@@ -12917,10 +12795,12 @@ rd_frame(void)
CTRL_EntityList processes = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Process); CTRL_EntityList processes = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Process);
if(processes.count == 0 || kind == RD_CmdKind_Restart) if(processes.count == 0 || kind == RD_CmdKind_Restart)
{ {
RD_EntityList bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint); RD_CfgList bps = rd_cfg_top_level_list_from_string(scratch.arena, str8_lit("breakpoint"));
for(RD_EntityNode *n = bps.first; n != 0; n = n->next) for(RD_CfgNode *n = bps.first; n != 0; n = n->next)
{ {
n->entity->u64 = 0; RD_Cfg *hit_count = rd_cfg_child_from_string_or_alloc(n->v, str8_lit("hit_count"));
rd_cfg_release_all_children(hit_count);
rd_cfg_new(hit_count, str8_lit("0"));
} }
} }
} // fallthrough } // fallthrough
@@ -13324,8 +13204,6 @@ rd_frame(void)
//- rjf: keep track of recent projects //- rjf: keep track of recent projects
if(src == RD_CfgSrc_Project) if(src == RD_CfgSrc_Project)
{
//- TODO(rjf): @cfg keep track of recent projects
{ {
RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user")); RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"));
RD_CfgList recent_projects = rd_cfg_child_list_from_string(scratch.arena, user, str8_lit("recent_project")); RD_CfgList recent_projects = rd_cfg_child_list_from_string(scratch.arena, user, str8_lit("recent_project"));
@@ -13351,42 +13229,6 @@ rd_frame(void)
rd_cfg_release(recent_projects.last->v); rd_cfg_release(recent_projects.last->v);
} }
} }
RD_EntityList recent_projects = rd_query_cached_entity_list_with_kind(RD_EntityKind_RecentProject);
RD_Entity *recent_project = &rd_nil_entity;
for(RD_EntityNode *n = recent_projects.first; n != 0; n = n->next)
{
if(path_match_normalized(cfg_path, n->entity->string))
{
recent_project = n->entity;
break;
}
}
if(rd_entity_is_nil(recent_project))
{
recent_project = rd_entity_alloc(rd_entity_root(), RD_EntityKind_RecentProject);
rd_entity_equip_name(recent_project, path_normalized_from_string(scratch.arena, cfg_path));
rd_entity_equip_cfg_src(recent_project, RD_CfgSrc_User);
}
}
//- rjf: eliminate all existing entities which are derived from config
{
for EachEnumVal(RD_EntityKind, k)
{
RD_EntityKindFlags k_flags = rd_entity_kind_flags_table[k];
if(k_flags & RD_EntityKindFlag_IsSerializedToConfig)
{
RD_EntityList entities = rd_query_cached_entity_list_with_kind(k);
for(RD_EntityNode *n = entities.first; n != 0; n = n->next)
{
if(n->entity->cfg_src == src)
{
rd_entity_mark_for_deletion(n->entity);
}
}
}
}
}
//- rjf: apply all entities //- rjf: apply all entities
{ {
@@ -14070,11 +13912,7 @@ rd_frame(void)
F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size+1); F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size+1);
RD_Cfg *window = rd_cfg_from_handle(rd_regs()->window); RD_Cfg *window = rd_cfg_from_handle(rd_regs()->window);
RD_Cfg *main_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("main_font_size")); RD_Cfg *main_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("main_font_size"));
for(RD_Cfg *child = main_font_size->first, *next = &rd_nil_cfg; child != &rd_nil_cfg; child = next) rd_cfg_release_all_children(main_font_size);
{
next = child->next;
rd_cfg_release(child);
}
rd_cfg_newf(main_font_size, "%f", new_font_size); rd_cfg_newf(main_font_size, "%f", new_font_size);
}break; }break;
case RD_CmdKind_DecUIFontScale: case RD_CmdKind_DecUIFontScale:
@@ -14084,11 +13922,7 @@ rd_frame(void)
F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size-1); F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size-1);
RD_Cfg *window = rd_cfg_from_handle(rd_regs()->window); RD_Cfg *window = rd_cfg_from_handle(rd_regs()->window);
RD_Cfg *main_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("main_font_size")); RD_Cfg *main_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("main_font_size"));
for(RD_Cfg *child = main_font_size->first, *next = &rd_nil_cfg; child != &rd_nil_cfg; child = next) rd_cfg_release_all_children(main_font_size);
{
next = child->next;
rd_cfg_release(child);
}
rd_cfg_newf(main_font_size, "%f", new_font_size); rd_cfg_newf(main_font_size, "%f", new_font_size);
}break; }break;
case RD_CmdKind_IncCodeFontScale: case RD_CmdKind_IncCodeFontScale:
@@ -14098,11 +13932,7 @@ rd_frame(void)
F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size+1); F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size+1);
RD_Cfg *window = rd_cfg_from_handle(rd_regs()->window); RD_Cfg *window = rd_cfg_from_handle(rd_regs()->window);
RD_Cfg *code_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("code_font_size")); RD_Cfg *code_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("code_font_size"));
for(RD_Cfg *child = code_font_size->first, *next = &rd_nil_cfg; child != &rd_nil_cfg; child = next) rd_cfg_release_all_children(code_font_size);
{
next = child->next;
rd_cfg_release(child);
}
rd_cfg_newf(code_font_size, "%f", new_font_size); rd_cfg_newf(code_font_size, "%f", new_font_size);
}break; }break;
case RD_CmdKind_DecCodeFontScale: case RD_CmdKind_DecCodeFontScale:
@@ -14112,11 +13942,7 @@ rd_frame(void)
F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size-1); F32 new_font_size = clamp_1f32(r1f32(6, 72), current_font_size-1);
RD_Cfg *window = rd_cfg_from_handle(rd_regs()->window); RD_Cfg *window = rd_cfg_from_handle(rd_regs()->window);
RD_Cfg *code_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("code_font_size")); RD_Cfg *code_font_size = rd_cfg_child_from_string_or_alloc(window, str8_lit("code_font_size"));
for(RD_Cfg *child = code_font_size->first, *next = &rd_nil_cfg; child != &rd_nil_cfg; child = next) rd_cfg_release_all_children(code_font_size);
{
next = child->next;
rd_cfg_release(child);
}
rd_cfg_newf(code_font_size, "%f", new_font_size); rd_cfg_newf(code_font_size, "%f", new_font_size);
}break; }break;
@@ -14433,21 +14259,13 @@ rd_frame(void)
String8 map_src = str8_list_join(scratch.arena, &map_src_parts, &map_join); String8 map_src = str8_list_join(scratch.arena, &map_src_parts, &map_join);
String8 map_dst = str8_list_join(scratch.arena, &map_dst_parts, &map_join); String8 map_dst = str8_list_join(scratch.arena, &map_dst_parts, &map_join);
//- rjf: store as file path map entity //- rjf: store as file path map cfg
//- TODO(rjf): @cfg store as file path map entity
{
RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user")); RD_Cfg *user = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"));
RD_Cfg *map = rd_cfg_new(user, str8_lit("file_path_map")); RD_Cfg *map = rd_cfg_new(user, str8_lit("file_path_map"));
RD_Cfg *src = rd_cfg_new(map, str8_lit("source")); RD_Cfg *src = rd_cfg_new(map, str8_lit("source"));
RD_Cfg *dst = rd_cfg_new(map, str8_lit("dest")); RD_Cfg *dst = rd_cfg_new(map, str8_lit("dest"));
rd_cfg_new(src, map_src); rd_cfg_new(src, map_src);
rd_cfg_new(dst, map_dst); rd_cfg_new(dst, map_dst);
}
RD_Entity *map = rd_entity_alloc(rd_entity_root(), RD_EntityKind_FilePathMap);
RD_Entity *src = rd_entity_alloc(map, RD_EntityKind_Source);
RD_Entity *dst = rd_entity_alloc(map, RD_EntityKind_Dest);
rd_entity_equip_name(src, map_src);
rd_entity_equip_name(dst, map_dst);
}break; }break;
//- rjf: panel removal //- rjf: panel removal
@@ -14680,17 +14498,13 @@ rd_frame(void)
}break; }break;
case RD_CmdKind_TabBarTop: case RD_CmdKind_TabBarTop:
{ {
#if 0 // TODO(rjf): @cfg RD_Cfg *panel = rd_cfg_from_handle(rd_regs()->panel);
RD_Panel *panel = rd_panel_from_handle(rd_regs()->panel); rd_cfg_release(rd_cfg_child_from_string(panel, str8_lit("tabs_on_bottom")));
panel->tab_side = Side_Min;
#endif
}break; }break;
case RD_CmdKind_TabBarBottom: case RD_CmdKind_TabBarBottom:
{ {
#if 0 // TODO(rjf): @cfg RD_Cfg *panel = rd_cfg_from_handle(rd_regs()->panel);
RD_Panel *panel = rd_panel_from_handle(rd_regs()->panel); rd_cfg_child_from_string_or_alloc(panel, str8_lit("tabs_on_bottom"));
panel->tab_side = Side_Max;
#endif
}break; }break;
//- rjf: files //- rjf: files
@@ -14808,9 +14622,6 @@ rd_frame(void)
if(rd_regs()->file_path.size != 0) if(rd_regs()->file_path.size != 0)
{ {
String8 path = path_normalized_from_string(scratch.arena, rd_regs()->file_path); String8 path = path_normalized_from_string(scratch.arena, rd_regs()->file_path);
//- TODO(rjf): @cfg record file in project
{
RD_Cfg *project = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("project")); RD_Cfg *project = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("project"));
RD_CfgList recent_files = rd_cfg_child_list_from_string(scratch.arena, project, str8_lit("recent_files")); RD_CfgList recent_files = rd_cfg_child_list_from_string(scratch.arena, project, str8_lit("recent_files"));
RD_Cfg *recent_file = &rd_nil_cfg; RD_Cfg *recent_file = &rd_nil_cfg;
@@ -14834,32 +14645,6 @@ rd_frame(void)
{ {
rd_cfg_release(recent_files.last->v); rd_cfg_release(recent_files.last->v);
} }
}
RD_EntityList recent_files = rd_query_cached_entity_list_with_kind(RD_EntityKind_RecentFile);
if(recent_files.count >= 256)
{
rd_entity_mark_for_deletion(recent_files.first->entity);
}
RD_Entity *existing_recent_file = &rd_nil_entity;
for(RD_EntityNode *n = recent_files.first; n != 0; n = n->next)
{
if(str8_match(n->entity->string, path, StringMatchFlag_CaseInsensitive))
{
existing_recent_file = n->entity;
break;
}
}
if(rd_entity_is_nil(existing_recent_file))
{
RD_Entity *recent_file = rd_entity_alloc(rd_entity_root(), RD_EntityKind_RecentFile);
rd_entity_equip_name(recent_file, path);
rd_entity_equip_cfg_src(recent_file, RD_CfgSrc_Project);
}
else
{
rd_entity_change_parent(existing_recent_file, rd_entity_root(), rd_entity_root(), rd_entity_root()->last);
}
}break; }break;
case RD_CmdKind_ShowFileInExplorer: case RD_CmdKind_ShowFileInExplorer:
if(rd_regs()->file_path.size != 0) if(rd_regs()->file_path.size != 0)
@@ -16145,124 +15930,95 @@ X(getting_started)
}break; }break;
//- rjf: general entity operations //- rjf: general entity operations
case RD_CmdKind_SelectEntity: case RD_CmdKind_SelectCfg:
case RD_CmdKind_SelectTarget: case RD_CmdKind_SelectTarget:
{ {
RD_Entity *entity = rd_entity_from_handle(rd_regs()->entity); RD_Cfg *cfg = rd_cfg_from_handle(rd_regs()->cfg);
RD_EntityList all_of_the_same_kind = rd_query_cached_entity_list_with_kind(entity->kind); RD_CfgList all_of_the_same_kind = rd_cfg_top_level_list_from_string(scratch.arena, cfg->string);
B32 is_selected = !entity->disabled; B32 is_selected = rd_disabled_from_cfg(cfg);
for(RD_EntityNode *n = all_of_the_same_kind.first; n != 0; n = n->next) for(RD_CfgNode *n = all_of_the_same_kind.first; n != 0; n = n->next)
{ {
RD_Entity *e = n->entity; RD_Cfg *c = n->v;
rd_entity_equip_disabled(e, 1); rd_cfg_child_from_string_or_alloc(c, str8_lit("disabled"));
} }
if(!is_selected) if(!is_selected)
{ {
rd_entity_equip_disabled(entity, 0); rd_cfg_release(rd_cfg_child_from_string(cfg, str8_lit("disabled")));
} }
}break; }break;
case RD_CmdKind_EnableEntity: case RD_CmdKind_EnableCfg:
case RD_CmdKind_EnableBreakpoint: case RD_CmdKind_EnableBreakpoint:
case RD_CmdKind_EnableTarget: case RD_CmdKind_EnableTarget:
{ {
RD_Entity *entity = rd_entity_from_handle(rd_regs()->entity); RD_Cfg *cfg = rd_cfg_from_handle(rd_regs()->cfg);
rd_entity_equip_disabled(entity, 0); rd_cfg_release(rd_cfg_child_from_string(cfg, str8_lit("disabled")));
}break; }break;
case RD_CmdKind_DisableEntity: case RD_CmdKind_DisableCfg:
case RD_CmdKind_DisableBreakpoint: case RD_CmdKind_DisableBreakpoint:
case RD_CmdKind_DisableTarget: case RD_CmdKind_DisableTarget:
{ {
RD_Entity *entity = rd_entity_from_handle(rd_regs()->entity); RD_Cfg *cfg = rd_cfg_from_handle(rd_regs()->cfg);
rd_entity_equip_disabled(entity, 1); rd_cfg_child_from_string_or_alloc(cfg, str8_lit("disabled"));
}break; }break;
case RD_CmdKind_RemoveEntity: case RD_CmdKind_RemoveCfg:
{ {
RD_Entity *entity = rd_entity_from_handle(rd_regs()->entity); RD_Cfg *cfg = rd_cfg_from_handle(rd_regs()->cfg);
RD_EntityKindFlags kind_flags = rd_entity_kind_flags_table[entity->kind]; rd_cfg_release(cfg);
if(kind_flags & RD_EntityKindFlag_CanDelete)
{
rd_entity_mark_for_deletion(entity);
}
}break; }break;
case RD_CmdKind_NameEntity: case RD_CmdKind_NameCfg:
{ {
RD_Entity *entity = rd_entity_from_handle(rd_regs()->entity); RD_Cfg *cfg = rd_cfg_from_handle(rd_regs()->cfg);
String8 string = rd_regs()->string; if(rd_regs()->string.size != 0)
rd_entity_equip_name(entity, string);
}break;
case RD_CmdKind_ConditionEntity:
{ {
RD_Entity *entity = rd_entity_from_handle(rd_regs()->entity); RD_Cfg *label = rd_cfg_child_from_string_or_alloc(cfg, str8_lit("label"));
String8 string = rd_regs()->string; rd_cfg_new(label, rd_regs()->string);
if(string.size != 0)
{
RD_Entity *child = rd_entity_child_from_kind_or_alloc(entity, RD_EntityKind_Condition);
rd_entity_equip_name(child, string);
} }
else else
{ {
RD_Entity *child = rd_entity_child_from_kind(entity, RD_EntityKind_Condition); rd_cfg_release(rd_cfg_child_from_string(cfg, str8_lit("label")));
rd_entity_mark_for_deletion(child);
} }
}break; }break;
case RD_CmdKind_DuplicateEntity: case RD_CmdKind_ConditionCfg:
{ {
RD_Entity *src = rd_entity_from_handle(rd_regs()->entity); RD_Cfg *cfg = rd_cfg_from_handle(rd_regs()->cfg);
if(!rd_entity_is_nil(src)) if(rd_regs()->string.size != 0)
{ {
typedef struct Task Task; RD_Cfg *cnd = rd_cfg_child_from_string_or_alloc(cfg, str8_lit("condition"));
struct Task rd_cfg_new(cnd, rd_regs()->string);
{
Task *next;
RD_Entity *src_n;
RD_Entity *dst_parent;
};
Task starter_task = {0, src, src->parent};
Task *first_task = &starter_task;
Task *last_task = &starter_task;
for(Task *task = first_task; task != 0; task = task->next)
{
RD_Entity *src_n = task->src_n;
RD_Entity *dst_n = rd_entity_alloc(task->dst_parent, task->src_n->kind);
if(src_n->flags & RD_EntityFlag_HasTextPoint) {rd_entity_equip_txt_pt(dst_n, src_n->text_point);}
if(src_n->flags & RD_EntityFlag_HasU64) {rd_entity_equip_u64(dst_n, src_n->u64);}
if(src_n->flags & RD_EntityFlag_HasColor) {rd_entity_equip_color_hsva(dst_n, rd_hsva_from_entity(src_n));}
if(src_n->flags & RD_EntityFlag_HasVAddr) {rd_entity_equip_vaddr(dst_n, src_n->vaddr);}
if(src_n->disabled) {rd_entity_equip_disabled(dst_n, 1);}
if(src_n->string.size != 0) {rd_entity_equip_name(dst_n, src_n->string);}
dst_n->cfg_src = src_n->cfg_src;
for(RD_Entity *src_child = task->src_n->first; !rd_entity_is_nil(src_child); src_child = src_child->next)
{
Task *child_task = push_array(scratch.arena, Task, 1);
child_task->src_n = src_child;
child_task->dst_parent = dst_n;
SLLQueuePush(first_task, last_task, child_task);
}
} }
else
{
rd_cfg_release(rd_cfg_child_from_string(cfg, str8_lit("condition")));
} }
}break; }break;
case RD_CmdKind_RelocateEntity: case RD_CmdKind_DuplicateCfg:
{ {
RD_Entity *entity = rd_entity_from_handle(rd_regs()->entity); RD_Cfg *src = rd_cfg_from_handle(rd_regs()->cfg);
RD_Entity *location = rd_entity_child_from_kind(entity, RD_EntityKind_Location); RD_Cfg *dst = rd_cfg_deep_copy(src);
if(rd_entity_is_nil(location)) rd_cfg_insert_child(src->parent, src, dst);
}break;
case RD_CmdKind_RelocateCfg:
{ {
location = rd_entity_alloc(entity, RD_EntityKind_Location); RD_Cfg *cfg = rd_cfg_from_handle(rd_regs()->cfg);
RD_Cfg *loc = rd_cfg_child_from_string_or_alloc(cfg, str8_lit("location"));
for(RD_Cfg *child = loc->first, *next = &rd_nil_cfg; child != &rd_nil_cfg; child = next)
{
next = child->next;
rd_cfg_release(child);
} }
location->flags &= ~RD_EntityFlag_HasTextPoint;
location->flags &= ~RD_EntityFlag_HasVAddr;
if(rd_regs()->cursor.line != 0) if(rd_regs()->cursor.line != 0)
{ {
rd_entity_equip_txt_pt(location, rd_regs()->cursor); RD_Cfg *file = rd_cfg_new(loc, rd_regs()->file_path);
RD_Cfg *line = rd_cfg_newf(file, "%I64d", rd_regs()->cursor.line);
rd_cfg_newf(line, "%I64d", rd_regs()->cursor.column);
} }
if(rd_regs()->vaddr != 0) else if(rd_regs()->vaddr != 0)
{ {
rd_entity_equip_vaddr(location, rd_regs()->vaddr); rd_cfg_newf(loc, "0x%I64x", rd_regs()->vaddr);
rd_entity_equip_name(location, str8_zero());
} }
if(rd_regs()->file_path.size != 0) else if(rd_regs()->string.size != 0)
{ {
rd_entity_equip_name(location, rd_regs()->file_path); rd_cfg_new(loc, rd_regs()->string);
} }
}break; }break;
@@ -16275,8 +16031,6 @@ X(getting_started)
String8 string = rd_regs()->string; String8 string = rd_regs()->string;
U64 vaddr = rd_regs()->vaddr; U64 vaddr = rd_regs()->vaddr;
if(file_path.size != 0 || string.size != 0 || vaddr != 0) if(file_path.size != 0 || string.size != 0 || vaddr != 0)
{
//- TODO(rjf): @cfg add/toggle breakpoint
{ {
B32 removed_already_existing = 0; B32 removed_already_existing = 0;
if(kind == RD_CmdKind_ToggleBreakpoint) if(kind == RD_CmdKind_ToggleBreakpoint)
@@ -16319,44 +16073,6 @@ X(getting_started)
} }
} }
} }
B32 removed_already_existing = 0;
if(kind == RD_CmdKind_ToggleBreakpoint)
{
RD_EntityList bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
for(RD_EntityNode *n = bps.first; n != 0; n = n->next)
{
RD_Entity *bp = n->entity;
RD_Entity *loc = rd_entity_child_from_kind(bp, RD_EntityKind_Location);
if((loc->flags & RD_EntityFlag_HasTextPoint && path_match_normalized(loc->string, file_path) && loc->text_point.line == pt.line) ||
(loc->flags & RD_EntityFlag_HasVAddr && loc->vaddr == vaddr) ||
(!(loc->flags & RD_EntityFlag_HasTextPoint) && str8_match(loc->string, string, 0)))
{
rd_entity_mark_for_deletion(bp);
removed_already_existing = 1;
break;
}
}
}
if(!removed_already_existing)
{
RD_Entity *bp = rd_entity_alloc(rd_entity_root(), RD_EntityKind_Breakpoint);
rd_entity_equip_cfg_src(bp, RD_CfgSrc_Project);
RD_Entity *loc = rd_entity_alloc(bp, RD_EntityKind_Location);
if(vaddr != 0)
{
rd_entity_equip_vaddr(loc, vaddr);
}
else if(string.size != 0)
{
rd_entity_equip_name(loc, string);
}
else if(file_path.size != 0 && pt.line != 0)
{
rd_entity_equip_name(loc, file_path);
rd_entity_equip_txt_pt(loc, pt);
}
}
}
}break; }break;
case RD_CmdKind_AddAddressBreakpoint: case RD_CmdKind_AddAddressBreakpoint:
{ {
@@ -16375,8 +16091,6 @@ X(getting_started)
TxtPt pt = rd_regs()->cursor; TxtPt pt = rd_regs()->cursor;
String8 string = rd_regs()->string; String8 string = rd_regs()->string;
U64 vaddr = rd_regs()->vaddr; U64 vaddr = rd_regs()->vaddr;
//- TODO(rjf): @cfg add/toggle watch pin
{
B32 removed_already_existing = 0; B32 removed_already_existing = 0;
if(kind == RD_CmdKind_ToggleWatchPin) if(kind == RD_CmdKind_ToggleWatchPin)
{ {
@@ -16416,41 +16130,6 @@ X(getting_started)
rd_cfg_newf(file_path_cfg, "%I64d", pt.line); rd_cfg_newf(file_path_cfg, "%I64d", pt.line);
} }
} }
}
B32 removed_already_existing = 0;
if(kind == RD_CmdKind_ToggleWatchPin)
{
RD_EntityList wps = rd_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
for(RD_EntityNode *n = wps.first; n != 0; n = n->next)
{
RD_Entity *wp = n->entity;
RD_Entity *loc = rd_entity_child_from_kind(wp, RD_EntityKind_Location);
if(str8_match(wp->string, string, 0) &&
((loc->flags & RD_EntityFlag_HasTextPoint && path_match_normalized(loc->string, file_path) && loc->text_point.line == pt.line) ||
(loc->flags & RD_EntityFlag_HasVAddr && loc->vaddr == vaddr)))
{
rd_entity_mark_for_deletion(wp);
removed_already_existing = 1;
break;
}
}
}
if(!removed_already_existing)
{
RD_Entity *wp = rd_entity_alloc(rd_entity_root(), RD_EntityKind_WatchPin);
rd_entity_equip_name(wp, string);
rd_entity_equip_cfg_src(wp, RD_CfgSrc_Project);
RD_Entity *loc = rd_entity_alloc(wp, RD_EntityKind_Location);
if(file_path.size != 0 && pt.line != 0)
{
rd_entity_equip_name(loc, file_path);
rd_entity_equip_txt_pt(loc, pt);
}
else if(vaddr != 0)
{
rd_entity_equip_vaddr(loc, vaddr);
}
}
}break; }break;
//- rjf: watches //- rjf: watches
@@ -16525,8 +16204,6 @@ X(getting_started)
//- rjf: targets //- rjf: targets
case RD_CmdKind_AddTarget: case RD_CmdKind_AddTarget:
{
//- TODO(rjf): @cfg add new target
{ {
String8 file_path = rd_regs()->file_path; String8 file_path = rd_regs()->file_path;
RD_Cfg *project = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("project")); RD_Cfg *project = rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("project"));
@@ -16539,24 +16216,7 @@ X(getting_started)
RD_Cfg *wdir = rd_cfg_new(target, str8_lit("working_directory")); RD_Cfg *wdir = rd_cfg_new(target, str8_lit("working_directory"));
rd_cfg_newf(wdir, "%S/", working_directory); rd_cfg_newf(wdir, "%S/", working_directory);
} }
// TODO(rjf): (select target here) rd_cmd(RD_CmdKind_SelectCfg, .cfg = rd_handle_from_cfg(target));
}
// rjf: build target
RD_Entity *entity = &rd_nil_entity;
entity = rd_entity_alloc(rd_entity_root(), RD_EntityKind_Target);
rd_entity_equip_disabled(entity, 1);
rd_entity_equip_cfg_src(entity, RD_CfgSrc_Project);
RD_Entity *exe = rd_entity_alloc(entity, RD_EntityKind_Executable);
rd_entity_equip_name(exe, rd_regs()->file_path);
String8 working_dir = str8_chop_last_slash(rd_regs()->file_path);
if(working_dir.size != 0)
{
String8 working_dir_path = push_str8f(scratch.arena, "%S/", working_dir);
RD_Entity *execution_path = rd_entity_alloc(entity, RD_EntityKind_WorkingDirectory);
rd_entity_equip_name(execution_path, working_dir_path);
}
rd_cmd(RD_CmdKind_SelectTarget, .entity = rd_handle_from_entity(entity));
}break; }break;
//- rjf: jit-debugger registration //- rjf: jit-debugger registration
@@ -17222,20 +16882,21 @@ X(getting_started)
U64 meval_count = 0; U64 meval_count = 0;
MetaEvalNode *first_meval = 0; MetaEvalNode *first_meval = 0;
MetaEvalNode *last_meval = 0; MetaEvalNode *last_meval = 0;
RD_EntityList bp_entities = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint); RD_CfgList bp_cfgs = rd_cfg_top_level_list_from_string(scratch.arena, str8_lit("breakpoint"));
breakpoints.count = bp_entities.count; breakpoints.count = bp_cfgs.count;
breakpoints.v = push_array(scratch.arena, D_Breakpoint, breakpoints.count); breakpoints.v = push_array(scratch.arena, D_Breakpoint, breakpoints.count);
U64 idx = 0; U64 idx = 0;
for(RD_EntityNode *n = bp_entities.first; n != 0; n = n->next) for(RD_CfgNode *n = bp_cfgs.first; n != 0; n = n->next)
{ {
RD_Entity *src_bp = n->entity; RD_Cfg *src_bp = n->v;
if(src_bp->disabled) B32 src_bp_is_disabled = rd_disabled_from_cfg(src_bp);
if(src_bp_is_disabled)
{ {
breakpoints.count -= 1; breakpoints.count -= 1;
continue; continue;
} }
RD_Entity *src_bp_loc = rd_entity_child_from_kind(src_bp, RD_EntityKind_Location); RD_Location src_bp_loc = rd_location_from_cfg(src_bp);
RD_Entity *src_bp_cnd = rd_entity_child_from_kind(src_bp, RD_EntityKind_Condition); String8 src_bp_cnd = rd_cfg_child_from_string(src_bp, str8_lit("condition"))->first->string;
//- rjf: walk conditional breakpoint expression tree - for each leaf identifier, //- rjf: walk conditional breakpoint expression tree - for each leaf identifier,
// determine if it resolves to a meta-evaluation. if it does, compute the meta // determine if it resolves to a meta-evaluation. if it does, compute the meta
@@ -17248,7 +16909,7 @@ X(getting_started)
// or not it is 'static', w.r.t. the control thread. // or not it is 'static', w.r.t. the control thread.
// //
B32 is_static_for_ctrl_thread = 0; B32 is_static_for_ctrl_thread = 0;
if(src_bp_cnd->string.size != 0) if(src_bp_cnd.size != 0)
{ {
typedef struct ExprWalkTask ExprWalkTask; typedef struct ExprWalkTask ExprWalkTask;
struct ExprWalkTask struct ExprWalkTask
@@ -17256,7 +16917,7 @@ X(getting_started)
ExprWalkTask *next; ExprWalkTask *next;
E_Expr *expr; E_Expr *expr;
}; };
E_Expr *expr = e_parse_expr_from_text(scratch.arena, src_bp_cnd->string); E_Expr *expr = e_parse_expr_from_text(scratch.arena, src_bp_cnd);
ExprWalkTask start_task = {0, expr}; ExprWalkTask start_task = {0, expr};
ExprWalkTask *first_task = &start_task; ExprWalkTask *first_task = &start_task;
for(ExprWalkTask *t = first_task; t != 0; t = t->next) for(ExprWalkTask *t = first_task; t != 0; t = t->next)
@@ -17302,7 +16963,7 @@ X(getting_started)
B32 is_statically_disqualified = 0; B32 is_statically_disqualified = 0;
if(is_static_for_ctrl_thread) if(is_static_for_ctrl_thread)
{ {
E_Eval eval = e_eval_from_string(scratch.arena, src_bp_cnd->string); E_Eval eval = e_eval_from_string(scratch.arena, src_bp_cnd);
E_Eval value_eval = e_value_eval_from_eval(eval); E_Eval value_eval = e_value_eval_from_eval(eval);
if(value_eval.value.u64 == 0) if(value_eval.value.u64 == 0)
{ {
@@ -17319,11 +16980,11 @@ X(getting_started)
//- rjf: fill breakpoint //- rjf: fill breakpoint
D_Breakpoint *dst_bp = &breakpoints.v[idx]; D_Breakpoint *dst_bp = &breakpoints.v[idx];
dst_bp->file_path = src_bp_loc->string; dst_bp->file_path = src_bp_loc.file_path;
dst_bp->pt = src_bp_loc->text_point; dst_bp->pt = src_bp_loc.pt;
dst_bp->symbol_name = src_bp_loc->string; dst_bp->symbol_name = src_bp_loc.name;
dst_bp->vaddr = src_bp_loc->vaddr; dst_bp->vaddr = src_bp_loc.vaddr;
dst_bp->condition = src_bp_cnd->string; dst_bp->condition = src_bp_cnd;
idx += 1; idx += 1;
} }
@@ -17345,15 +17006,15 @@ X(getting_started)
// //
D_PathMapArray path_maps = {0}; D_PathMapArray path_maps = {0};
{ {
RD_EntityList maps = rd_query_cached_entity_list_with_kind(RD_EntityKind_FilePathMap); RD_CfgList maps = rd_cfg_top_level_list_from_string(scratch.arena, str8_lit("file_path_map"));
path_maps.count = maps.count; path_maps.count = maps.count;
path_maps.v = push_array(scratch.arena, D_PathMap, path_maps.count); path_maps.v = push_array(scratch.arena, D_PathMap, path_maps.count);
U64 idx = 0; U64 idx = 0;
for(RD_EntityNode *n = maps.first; n != 0; n = n->next, idx += 1) for(RD_CfgNode *n = maps.first; n != 0; n = n->next, idx += 1)
{ {
RD_Entity *map = n->entity; RD_Cfg *map = n->v;
path_maps.v[idx].src = rd_entity_child_from_kind(map, RD_EntityKind_Source)->string; path_maps.v[idx].src = rd_cfg_child_from_string(map, str8_lit("source"))->first->string;
path_maps.v[idx].dst = rd_entity_child_from_kind(map, RD_EntityKind_Dest)->string; path_maps.v[idx].dst = rd_cfg_child_from_string(map, str8_lit("dest"))->first->string;
} }
} }
@@ -17428,35 +17089,40 @@ X(getting_started)
// rjf: increment breakpoint hit counts // rjf: increment breakpoint hit counts
if(evt->cause == D_EventCause_UserBreakpoint) if(evt->cause == D_EventCause_UserBreakpoint)
{ {
RD_EntityList user_bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint); RD_CfgList bps = rd_cfg_top_level_list_from_string(scratch.arena, str8_lit("breakpoint"));
for(RD_EntityNode *n = user_bps.first; n != 0; n = n->next) for(RD_CfgNode *n = bps.first; n != 0; n = n->next)
{ {
RD_Entity *bp = n->entity; RD_Cfg *bp = n->v;
RD_Entity *loc = rd_entity_child_from_kind(bp, RD_EntityKind_Location); RD_Cfg *hit_count_root = rd_cfg_child_from_string_or_alloc(bp, str8_lit("hit_count"));
D_LineList loc_lines = d_lines_from_file_path_line_num(scratch.arena, loc->string, loc->text_point.line); U64 hit_count = 0;
try_u64_from_str8_c_rules(hit_count_root->first->string, &hit_count);
RD_Location loc = rd_location_from_cfg(bp);
D_LineList loc_lines = d_lines_from_file_path_line_num(scratch.arena, loc.file_path, loc.pt.line);
if(loc_lines.first != 0) if(loc_lines.first != 0)
{ {
for(D_LineNode *n = loc_lines.first; n != 0; n = n->next) for(D_LineNode *n = loc_lines.first; n != 0; n = n->next)
{ {
if(contains_1u64(n->v.voff_range, voff)) if(contains_1u64(n->v.voff_range, voff))
{ {
bp->u64 += 1; hit_count += 1;
break; break;
} }
} }
} }
else if(loc->flags & RD_EntityFlag_HasVAddr && vaddr == loc->vaddr) else if(loc.vaddr != 0 && vaddr == loc.vaddr)
{ {
bp->u64 += 1; hit_count += 1;
} }
else if(loc->string.size != 0) else if(loc.name.size != 0)
{ {
U64 symb_voff = d_voff_from_dbgi_key_symbol_name(&dbgi_key, loc->string); U64 symb_voff = d_voff_from_dbgi_key_symbol_name(&dbgi_key, loc.name);
if(symb_voff == voff) if(symb_voff == voff)
{ {
bp->u64 += 1; hit_count += 1;
} }
} }
rd_cfg_release_all_children(hit_count_root);
rd_cfg_newf(hit_count_root, "%I64u", hit_count);
} }
} }
+1 -1
View File
@@ -1138,6 +1138,7 @@ internal void rd_name_release(String8 string);
internal RD_Cfg *rd_cfg_alloc(void); internal RD_Cfg *rd_cfg_alloc(void);
internal void rd_cfg_release(RD_Cfg *cfg); internal void rd_cfg_release(RD_Cfg *cfg);
internal void rd_cfg_release_all_children(RD_Cfg *cfg);
internal RD_Handle rd_handle_from_cfg(RD_Cfg *cfg); internal RD_Handle rd_handle_from_cfg(RD_Cfg *cfg);
internal RD_Cfg *rd_cfg_from_handle(RD_Handle handle); internal RD_Cfg *rd_cfg_from_handle(RD_Handle handle);
internal RD_Cfg *rd_cfg_new(RD_Cfg *parent, String8 string); internal RD_Cfg *rd_cfg_new(RD_Cfg *parent, String8 string);
@@ -1218,7 +1219,6 @@ internal RD_Entity *rd_entity_from_name_and_kind(String8 string, RD_EntityKind k
//////////////////////////////// ////////////////////////////////
//~ rjf: Frontend Entity Info Extraction //~ rjf: Frontend Entity Info Extraction
internal D_Target rd_d_target_from_entity(RD_Entity *entity);
internal DR_FancyStringList rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_color, F32 size); internal DR_FancyStringList rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_color, F32 size);
//////////////////////////////// ////////////////////////////////
+10 -1806
View File
File diff suppressed because it is too large Load Diff
+17 -16
View File
@@ -1016,13 +1016,13 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: shift+click => enable breakpoint // rjf: shift+click => enable breakpoint
if(ui_clicked(bp_sig) && bp_sig.event_flags & OS_Modifier_Shift) if(ui_clicked(bp_sig) && bp_sig.event_flags & OS_Modifier_Shift)
{ {
rd_cmd(bp_is_disabled ? RD_CmdKind_EnableEntity : RD_CmdKind_DisableEntity, .cfg = rd_handle_from_cfg(bp)); rd_cmd(bp_is_disabled ? RD_CmdKind_EnableCfg : RD_CmdKind_DisableCfg, .cfg = rd_handle_from_cfg(bp));
} }
// rjf: click => remove breakpoint // rjf: click => remove breakpoint
if(ui_clicked(bp_sig) && bp_sig.event_flags == 0) if(ui_clicked(bp_sig) && bp_sig.event_flags == 0)
{ {
rd_cmd(RD_CmdKind_RemoveEntity, .cfg = rd_handle_from_cfg(bp)); rd_cmd(RD_CmdKind_RemoveCfg, .cfg = rd_handle_from_cfg(bp));
} }
// rjf: drag start // rjf: drag start
@@ -1077,7 +1077,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: click => remove pin // rjf: click => remove pin
if(ui_clicked(pin_sig)) if(ui_clicked(pin_sig))
{ {
rd_cmd(RD_CmdKind_RemoveEntity, .cfg = rd_handle_from_cfg(pin)); rd_cmd(RD_CmdKind_RemoveCfg, .cfg = rd_handle_from_cfg(pin));
} }
// rjf: drag start // rjf: drag start
@@ -1403,7 +1403,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
UI_Signal catchall_margin_container_sig = ui_signal_from_box(catchall_margin_container_box); UI_Signal catchall_margin_container_sig = ui_signal_from_box(catchall_margin_container_box);
UI_Signal text_container_sig = ui_signal_from_box(text_container_box); UI_Signal text_container_sig = ui_signal_from_box(text_container_box);
B32 line_drag_drop = 0; B32 line_drag_drop = 0;
RD_Entity *line_drag_entity = &rd_nil_entity; RD_Cfg *line_drag_cfg = &rd_nil_cfg;
CTRL_Entity *line_drag_ctrl_entity = &ctrl_entity_nil; CTRL_Entity *line_drag_ctrl_entity = &ctrl_entity_nil;
Vec4F32 line_drag_drop_color = rd_rgba_from_theme_color(RD_ThemeColor_DropSiteOverlay); Vec4F32 line_drag_drop_color = rd_rgba_from_theme_color(RD_ThemeColor_DropSiteOverlay);
{ {
@@ -1479,17 +1479,18 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
if(rd_drag_is_active() && contains_2f32(clipped_top_container_rect, ui_mouse())) if(rd_drag_is_active() && contains_2f32(clipped_top_container_rect, ui_mouse()))
{ {
CTRL_Entity *thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_state->drag_drop_regs->thread); CTRL_Entity *thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_state->drag_drop_regs->thread);
RD_Entity *entity = rd_entity_from_handle(rd_state->drag_drop_regs->entity); RD_Cfg *cfg = rd_cfg_from_handle(rd_state->drag_drop_regs->cfg);
if(rd_state->drag_drop_regs_slot == RD_RegSlot_Entity && if(rd_state->drag_drop_regs_slot == RD_RegSlot_Cfg &&
(entity->kind == RD_EntityKind_WatchPin || (str8_match(cfg->string, str8_lit("breakpoint"), 0) ||
entity->kind == RD_EntityKind_Breakpoint)) str8_match(cfg->string, str8_lit("watch_pin"), 0)))
{ {
line_drag_drop = 1; line_drag_drop = 1;
line_drag_entity = entity; line_drag_cfg = cfg;
if(entity->flags & RD_EntityFlag_HasColor) line_drag_drop_color = rd_rgba_from_cfg(cfg);
{
line_drag_drop_color = rd_rgba_from_entity(entity);
line_drag_drop_color.w *= 0.5f; line_drag_drop_color.w *= 0.5f;
if(line_drag_drop_color.w == 0)
{
line_drag_drop_color = rd_rgba_from_theme_color(RD_ThemeColor_DropSiteOverlay);
} }
} }
if(rd_state->drag_drop_regs_slot == RD_RegSlot_Thread) if(rd_state->drag_drop_regs_slot == RD_RegSlot_Thread)
@@ -1503,14 +1504,14 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
//- rjf: drop target is dropped -> process //- rjf: drop target is dropped -> process
{ {
if(!rd_entity_is_nil(line_drag_entity) && rd_drag_drop() && contains_1s64(params->line_num_range, mouse_pt.line)) if(line_drag_cfg != &rd_nil_cfg && rd_drag_drop() && contains_1s64(params->line_num_range, mouse_pt.line))
{ {
RD_Entity *dropped_entity = line_drag_entity; RD_Cfg *dropped_cfg = line_drag_cfg;
S64 line_num = mouse_pt.line; S64 line_num = mouse_pt.line;
U64 line_idx = line_num - params->line_num_range.min; U64 line_idx = line_num - params->line_num_range.min;
U64 line_vaddr = params->line_vaddrs[line_idx]; U64 line_vaddr = params->line_vaddrs[line_idx];
rd_cmd(RD_CmdKind_RelocateEntity, rd_cmd(RD_CmdKind_RelocateCfg,
.entity = rd_handle_from_entity(dropped_entity), .cfg = rd_handle_from_cfg(dropped_cfg),
.file_path = line_vaddr == 0 ? rd_regs()->file_path : str8_zero(), .file_path = line_vaddr == 0 ? rd_regs()->file_path : str8_zero(),
.cursor = line_vaddr == 0 ? txt_pt(line_num, 1) : txt_pt(0, 0), .cursor = line_vaddr == 0 ? txt_pt(line_num, 1) : txt_pt(0, 0),
.vaddr = line_vaddr); .vaddr = line_vaddr);