From 09f248de590a44b09bbaaa1ca9879d1bfbae235a Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Sat, 26 Apr 2025 10:02:56 -0700 Subject: [PATCH] cfg evaluation improvements, tab expression editing, window size serialization fix, other small fixes --- src/eval/eval_ir.c | 2 +- src/raddbg/generated/raddbg.meta.c | 4 +- src/raddbg/raddbg.mdesk | 4 + src/raddbg/raddbg_core.c | 152 ++++++++++++++++++----------- src/raddbg/raddbg_eval.c | 35 +++++-- src/raddbg/raddbg_eval.h | 17 ++-- src/raddbg/raddbg_views.c | 2 +- src/raddbg/raddbg_widgets.c | 4 +- 8 files changed, 146 insertions(+), 74 deletions(-) diff --git a/src/eval/eval_ir.c b/src/eval/eval_ir.c index d56fc852..f8cabbfe 100644 --- a/src/eval/eval_ir.c +++ b/src/eval/eval_ir.c @@ -365,7 +365,7 @@ E_TYPE_ACCESS_FUNCTION_DEF(default) E_Expr *exprl = expr->first; E_Expr *exprr = exprl->next; E_IRTreeAndType l = *lhs_irtree; - E_TypeKey l_restype = e_type_key_unwrap(l.type_key, E_TypeUnwrapFlag_AllDecorative); + E_TypeKey l_restype = e_type_key_unwrap(l.type_key, E_TypeUnwrapFlag_AllDecorative & ~E_TypeUnwrapFlag_Enums); E_TypeKind l_restype_kind = e_type_kind_from_key(l_restype); E_TypeKey check_type_key = l_restype; E_TypeKind check_type_kind = l_restype_kind; diff --git a/src/raddbg/generated/raddbg.meta.c b/src/raddbg/generated/raddbg.meta.c index 6359005b..ead90914 100644 --- a/src/raddbg/generated/raddbg.meta.c +++ b/src/raddbg/generated/raddbg.meta.c @@ -378,8 +378,8 @@ RD_NameSchemaInfo rd_name_schema_info_table[21] = {str8_lit_comp("project"), str8_lit_comp("x:\n{\n @default(2) @display_name('Project Tab Width') 'tab_width': @range[1, 32] u64,\n}\n")}, {str8_lit_comp("window"), str8_lit_comp("x:\n{\n //- rjf: text rasterization settings\n @default(1) @display_name('Smooth UI Text') @description(\"Controls whether or not UI text is fully anti-aliased, for a smoother appearance.\")\n 'smooth_ui_text': bool,\n @default(1) @display_name('Hint UI Text') @description(\"Controls whether or not UI text is hinted, for better text readability at small sizes.\")\n 'hint_ui_text': bool,\n @default(0) @display_name('Smooth Code Text') @description(\"Controls whether or not code text is fully anti-aliased, for a smoother appearance.\")\n 'smooth_code_text': bool,\n @default(1) @display_name('Hint Code Text') @description(\"Controls whether or not code text is hinted, for better text readability at small sizes.\")\n 'hint_code_text': bool,\n @default(11) @display_name('Window Font Size') @description(\"Controls the window's default font size. Does not apply to tabs with their own font size set.\")\n 'font_size': @range[6, 72] u64,\n\n //- rjf: size settings\n @default(3.f) @display_name('Window Row Height') @description(\"Controls the window's default row height, in multiples of the font size. Does not apply to tabs with their own row height set.\")\n 'row_height': @range[1.75f, 5.f] f32,\n @default(3.f) @description(\"Controls the height of tabs, in multiples of the font size.\")\n 'tab_height': @range[1.75f, 5.f] f32,\n}\n")}, {str8_lit_comp("tab"), str8_lit_comp("x:\n{\n @default(11) @display_name('Tab Font Size') @description(\"Controls the tab's font size.\")\n 'font_size': @range[6, 72] u64,\n}\n")}, -{str8_lit_comp("watch"), str8_lit_comp("@inherit(tab) x:\n{\n @default(3.f) @display_name('Tab Row Height') @description(\"Controls the tab's row height, in multiples of the font size.\")\n 'row_height': @range[1.75f, 5.f] f32,\n}\n")}, -{str8_lit_comp("text"), str8_lit_comp("@inherit(tab) x:\n{\n @description(\"The language that the text should be interpreted as being within. Used for syntax highlighting and other parsing features.\")\n 'lang': lang,\n @default(1) @description(\"Controls whether or not line numbers are shown.\")\n 'show_line_numbers':bool,\n @default(0) @display_name('Transient') @description(\"Controls whether or not this tab will be automatically replaced by the debugger when it snaps to new source code locations.\")\n 'auto': bool,\n}\n")}, +{str8_lit_comp("watch"), str8_lit_comp("@inherit(tab) x:\n{\n @default(3.f) @display_name('Tab Row Height') @description(\"Controls the tab's row height, in multiples of the font size.\")\n 'row_height': @range[1.75f, 5.f] f32,\n @description(\"The root expression which is evaluated to produce the watch window.\")\n 'expression': code_string,\n}\n")}, +{str8_lit_comp("text"), str8_lit_comp("@inherit(tab) x:\n{\n @description(\"The language that the text should be interpreted as being within. Used for syntax highlighting and other parsing features.\")\n 'lang': lang,\n @default(1) @description(\"Controls whether or not line numbers are shown.\")\n 'show_line_numbers':bool,\n @default(0) @display_name('Transient') @description(\"Controls whether or not this tab will be automatically replaced by the debugger when it snaps to new source code locations.\")\n 'auto': bool,\n @description(\"An expression to describe data which should be viewed as text or code.\")\n 'expression': code_string,\n}\n")}, {str8_lit_comp("disasm"), str8_lit_comp("@inherit(tab) x:\n{\n @description(\"An expression to describe the base address or offset of the disassembly.\")\n 'expression': code_string,\n 'arch': arch,\n 'syntax': dasm_syntax,\n 'size': code_string,\n @default(1) @description(\"Controls whether or not addresses are shown in the disassembly text.\")\n 'show_addresses': bool,\n @default(0) @description(\"Controls whether or not code bytes are shown in the disassembly text.\")\n 'show_code_bytes': bool,\n @default(1) @description(\"Controls whether or not source lines, corresponding to disassembly instruction ranges, are shown in the disassembly text.\")\n 'show_source_lines': bool,\n @default(1) @description(\"Controls whether or not disassembly text is decorated with symbol names.\")\n 'show_symbol_names': bool,\n @default(1) @description(\"Controls whether or not line numbers are shown.\")\n 'show_line_numbers': bool,\n}\n")}, {str8_lit_comp("memory"), str8_lit_comp("@inherit(tab) x:\n{\n @description(\"An expression to describe the base address or offset of the memory view.\")\n 'expression': code_string,\n @description(\"The number of bytes of the viewed memory range.\")\n 'size': code_string,\n @default(16) @description(\"The number of columns to build before building new rows.\")\n 'num_columns': @range[1, 64] u64,\n @default(1) @description(\"The number of bytes that each cell should represent.\")\n 'bytes_per_cell': @range[1, 8] u64,\n}\n")}, {str8_lit_comp("bitmap"), str8_lit_comp("@inherit(tab) x:\n{\n @display_name(\"Base Pointer\") @description(\"An expression to describe the base address or offset of the bitmap data.\")\n 'expression': code_string,\n @order(0) 'w': u64,\n @order(1) 'h': u64,\n @display_name(\"Bitmap Format\") @description(\"The pixel format that the bitmap data should be interpreted as being within.\")\n 'fmt': tex2dformat,\n}\n")}, diff --git a/src/raddbg/raddbg.mdesk b/src/raddbg/raddbg.mdesk index fd92ac2f..ce97c431 100644 --- a/src/raddbg/raddbg.mdesk +++ b/src/raddbg/raddbg.mdesk @@ -315,6 +315,8 @@ RD_VocabTable: { @default(3.f) @display_name('Tab Row Height') @description("Controls the tab's row height, in multiples of the font size.") 'row_height': @range[1.75f, 5.f] f32, + @description("The root expression which is evaluated to produce the watch window.") + 'expression': code_string, } ``` } @@ -329,6 +331,8 @@ RD_VocabTable: 'show_line_numbers':bool, @default(0) @display_name('Transient') @description("Controls whether or not this tab will be automatically replaced by the debugger when it snaps to new source code locations.") 'auto': bool, + @description("An expression to describe data which should be viewed as text or code.") + 'expression': code_string, } ``` } diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index 8569645d..2821b1e7 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -5573,6 +5573,7 @@ rd_window_frame(void) Temp scratch = scratch_begin(0, 0); B32 is_fullscreen = os_window_is_fullscreen(ws->os); B32 is_maximized = os_window_is_maximized(ws->os); + B32 is_minimized = os_window_is_minimized(ws->os); if(is_fullscreen) { rd_cfg_child_from_string_or_alloc(window, str8_lit("fullscreen")); @@ -5592,7 +5593,7 @@ rd_window_frame(void) //- rjf: commit position Rng2F32 window_rect = os_rect_from_window(ws->os); - if(!is_fullscreen && !is_maximized) + if(!is_fullscreen && !is_maximized && !is_minimized) { Vec2F32 pos = window_rect.p0; RD_Cfg *pos_root = rd_cfg_child_from_string_or_alloc(window, str8_lit("pos")); @@ -5617,7 +5618,7 @@ rd_window_frame(void) } //- rjf: commit size - if(!is_fullscreen && !is_maximized) + if(!is_fullscreen && !is_maximized && !is_minimized) { Vec2F32 size = dim_2f32(window_rect); RD_Cfg *size_root = rd_cfg_child_from_string_or_alloc(window, str8_lit("size")); @@ -5642,6 +5643,7 @@ rd_window_frame(void) } //- rjf: commit monitor + if(!is_minimized) { OS_Handle monitor = os_monitor_from_window(ws->os); String8 monitor_name = os_name_from_monitor(scratch.arena, monitor); @@ -8448,7 +8450,7 @@ rd_window_frame(void) { rd_cmd(RD_CmdKind_PushQuery, .ui_key = sig.box->key, - .expr = push_str8f(scratch.arena, "$%I64x", tab->id)); + .expr = push_str8f(scratch.arena, "query:config.$%I64x", tab->id)); } else if(ui_middle_clicked(sig)) { @@ -8543,11 +8545,20 @@ rd_window_frame(void) if(ui_pressed(sig)) { rd_cmd(RD_CmdKind_FocusPanel, .panel = panel->cfg->id); - rd_cmd(RD_CmdKind_PushQuery, .expr = str8_lit("query:tab_commands"), - .panel = panel->cfg->id, - .do_implicit_root = 1, - .do_lister = 1, - .ui_key = add_new_box->key); + if(ws->query_is_active && + ui_key_match(add_new_box->key, ws->query_regs->ui_key)) + { + rd_cmd(RD_CmdKind_CancelQuery); + } + else + { + rd_cmd(RD_CmdKind_PushQuery, + .expr = str8_lit("query:tab_commands"), + .panel = panel->cfg->id, + .do_implicit_root = 1, + .do_lister = 1, + .ui_key = add_new_box->key); + } } } } @@ -11880,7 +11891,20 @@ rd_frame(void) e_string2typekey_map_insert(rd_frame_arena(), rd_state->meta_name2type_map, name, type_key); } - //- rjf: add macros for evallable top-level config trees + //- rjf: add macro for top-level config root + { + String8 name = str8_lit("config"); + E_TypeKey type_key = e_type_key_cons(.name = name, + .kind = E_TypeKind_Set, + .access = E_TYPE_ACCESS_FUNCTION_NAME(cfgs)); + E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0); + expr->type_key = type_key; + expr->space = e_space_make(RD_EvalSpaceKind_MetaQuery); + e_string2expr_map_insert(scratch.arena, macro_map, name, expr); + e_string2typekey_map_insert(rd_frame_arena(), rd_state->meta_name2type_map, name, type_key); + } + + //- rjf: add macros for config "slice" collections (targets, breakpoints, etc.) String8 evallable_cfg_names[] = { str8_lit("breakpoint"), @@ -11891,29 +11915,68 @@ rd_frame(void) str8_lit("recent_project"), str8_lit("recent_file"), }; - for EachElement(idx, evallable_cfg_names) + for EachElement(cfg_name_idx, evallable_cfg_names) { - String8 name = evallable_cfg_names[idx]; - E_TypeKey type_key = e_string2typekey_map_lookup(rd_state->meta_name2type_map, name); - RD_CfgList cfgs = rd_cfg_top_level_list_from_string(scratch.arena, name); - for(RD_CfgNode *n = cfgs.first; n != 0; n = n->next) + String8 cfg_name = evallable_cfg_names[cfg_name_idx]; + String8 collection_name = rd_plural_from_code_name(cfg_name); + E_TypeKey collection_type_key = e_type_key_cons(.kind = E_TypeKind_Set, .name = collection_name, + .irext = E_TYPE_IREXT_FUNCTION_NAME(cfgs_slice), + .access = E_TYPE_ACCESS_FUNCTION_NAME(cfgs_slice), + .expand = + { + .info = E_TYPE_EXPAND_INFO_FUNCTION_NAME(cfgs_slice), + .range= E_TYPE_EXPAND_RANGE_FUNCTION_NAME(cfgs_slice), + .id_from_num = E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(cfgs_slice), + .num_from_id = E_TYPE_EXPAND_NUM_FROM_ID_FUNCTION_NAME(cfgs_slice), + }); + E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0); + expr->type_key = collection_type_key; + expr->space = e_space_make(RD_EvalSpaceKind_MetaQuery); + e_string2expr_map_insert(scratch.arena, macro_map, collection_name, expr); + e_string2typekey_map_insert(rd_frame_arena(), rd_state->meta_name2type_map, collection_name, collection_type_key); + } + + //- rjf: add macros for evallable top-level individual config entity trees - + // things with names either explicitly attached, or that we can infer + for EachElement(idx, rd_name_schema_info_table) + { + String8 name = rd_name_schema_info_table[idx].name; + MD_NodePtrList schemas = rd_schemas_from_name(name); + B32 is_individually_evallable = 0; + for(MD_NodePtrNode *n = schemas.first; n != 0; n = n->next) { - RD_Cfg *cfg = n->v; - String8 label = rd_cfg_child_from_string(cfg, str8_lit("label"))->first->string; - String8 exe = rd_cfg_child_from_string(cfg, str8_lit("executable"))->first->string; - E_Space space = rd_eval_space_from_cfg(cfg); - E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0); - expr->space = space; - expr->mode = E_Mode_Offset; - expr->type_key = type_key; - e_string2expr_map_insert(scratch.arena, macro_map, push_str8f(scratch.arena, "$%I64x", cfg->id), expr); - if(exe.size != 0) + if(md_node_has_child(n->v, str8_lit("label"), 0) || + md_node_has_child(n->v, str8_lit("executable"), 0)) { - e_string2expr_map_insert(scratch.arena, macro_map, str8_skip_last_slash(exe), expr); + is_individually_evallable = 1; + break; } - if(label.size != 0) + } + if(is_individually_evallable) + { + E_TypeKey type_key = e_string2typekey_map_lookup(rd_state->meta_name2type_map, name); + RD_CfgList cfgs = rd_cfg_top_level_list_from_string(scratch.arena, name); + for(RD_CfgNode *n = cfgs.first; n != 0; n = n->next) { - e_string2expr_map_insert(scratch.arena, macro_map, label, expr); + RD_Cfg *cfg = n->v; + String8 label = rd_cfg_child_from_string(cfg, str8_lit("label"))->first->string; + String8 exe = rd_cfg_child_from_string(cfg, str8_lit("executable"))->first->string; + if(exe.size != 0 || label.size != 0) + { + E_Space space = rd_eval_space_from_cfg(cfg); + E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0); + expr->space = space; + expr->mode = E_Mode_Offset; + expr->type_key = type_key; + if(exe.size != 0) + { + e_string2expr_map_insert(scratch.arena, macro_map, str8_skip_last_slash(exe), expr); + } + if(label.size != 0) + { + e_string2expr_map_insert(scratch.arena, macro_map, label, expr); + } + } } } } @@ -11983,28 +12046,6 @@ rd_frame(void) } } - //- rjf: add macros for all config collections - for EachElement(cfg_name_idx, evallable_cfg_names) - { - String8 cfg_name = evallable_cfg_names[cfg_name_idx]; - String8 collection_name = rd_plural_from_code_name(cfg_name); - E_TypeKey collection_type_key = e_type_key_cons(.kind = E_TypeKind_Set, .name = collection_name, - .irext = E_TYPE_IREXT_FUNCTION_NAME(cfgs), - .access = E_TYPE_ACCESS_FUNCTION_NAME(cfgs), - .expand = - { - .info = E_TYPE_EXPAND_INFO_FUNCTION_NAME(cfgs), - .range= E_TYPE_EXPAND_RANGE_FUNCTION_NAME(cfgs), - .id_from_num = E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(cfgs), - .num_from_id = E_TYPE_EXPAND_NUM_FROM_ID_FUNCTION_NAME(cfgs), - }); - E_Expr *expr = e_push_expr(scratch.arena, E_ExprKind_LeafOffset, 0); - expr->type_key = collection_type_key; - expr->space = e_space_make(RD_EvalSpaceKind_MetaQuery); - e_string2expr_map_insert(scratch.arena, macro_map, collection_name, expr); - e_string2typekey_map_insert(rd_frame_arena(), rd_state->meta_name2type_map, collection_name, collection_type_key); - } - //- rjf: add macros for windows/tabs { RD_CfgList windows = rd_cfg_top_level_list_from_string(scratch.arena, str8_lit("window")); @@ -12018,7 +12059,7 @@ rd_frame(void) expr->space = space; expr->mode = E_Mode_Offset; expr->type_key = type_key; - e_string2expr_map_insert(scratch.arena, macro_map, push_str8f(scratch.arena, "$%I64x", window->id), expr); + e_string2expr_map_insert(scratch.arena, macro_map, push_str8f(scratch.arena, "query:config.$%I64x", window->id), expr); } RD_PanelTree panel_tree = rd_panel_tree_from_cfg(scratch.arena, window); for(RD_PanelNode *p = panel_tree.root; @@ -12034,7 +12075,7 @@ rd_frame(void) expr->space = space; expr->mode = E_Mode_Offset; expr->type_key = type_key; - e_string2expr_map_insert(scratch.arena, macro_map, push_str8f(scratch.arena, "$%I64x", tab->id), expr); + e_string2expr_map_insert(scratch.arena, macro_map, push_str8f(scratch.arena, "query:config.$%I64x", tab->id), expr); } } } @@ -12545,8 +12586,8 @@ rd_frame(void) RD_Cfg *tab = panel_tree.focused->selected_tab; String8 expr = push_str8f(scratch.arena, "query:commands, " - "query:$%I64x, " - "query:$%I64x, " + "query:config.$%I64x, " + "query:config.$%I64x, " "query:targets, " "query:breakpoints, " "query:recent_files, " @@ -12646,7 +12687,7 @@ rd_frame(void) }break; case RD_CmdKind_WindowSettings: { - String8 expr = push_str8f(scratch.arena, "query:$%I64x", rd_regs()->window); + String8 expr = push_str8f(scratch.arena, "query:config.$%I64x", rd_regs()->window); rd_cmd(RD_CmdKind_PushQuery, .expr = expr, .do_implicit_root = 1, .do_big_rows = 1, .do_lister = 1); }break; case RD_CmdKind_CloseWindow: @@ -13678,7 +13719,7 @@ rd_frame(void) }break; case RD_CmdKind_TabSettings: { - String8 expr = push_str8f(scratch.arena, "query:$%I64x", rd_regs()->view); + String8 expr = push_str8f(scratch.arena, "query:config.$%I64x", rd_regs()->view); rd_cmd(RD_CmdKind_PushQuery, .expr = expr, .do_implicit_root = 1, .do_big_rows = 1, .do_lister = 1); }break; @@ -15129,6 +15170,7 @@ rd_frame(void) rd_cfg_newf(wdir, "%S/", working_directory); } rd_cmd(RD_CmdKind_SelectTarget, .cfg = target->id); + rd_cmd(RD_CmdKind_PushQuery, .expr = push_str8f(scratch.arena, "query:config.$%I64x", target->id)); }break; //- rjf: jit-debugger registration diff --git a/src/raddbg/raddbg_eval.c b/src/raddbg/raddbg_eval.c index 98343f95..78327684 100644 --- a/src/raddbg/raddbg_eval.c +++ b/src/raddbg/raddbg_eval.c @@ -613,6 +613,27 @@ E_TYPE_EXPAND_RANGE_FUNCTION_DEF(schema) } } +//////////////////////////////// +//~ rjf: Config Type Hooks + +E_TYPE_ACCESS_FUNCTION_DEF(cfgs) +{ + E_IRTreeAndType result = {&e_irnode_nil}; + E_Expr *rhs = expr->first->next; + if(rhs->kind == E_ExprKind_LeafIdentifier && + str8_match(str8_prefix(rhs->string, 1), str8_lit("$"), 0)) + { + String8 numeric_part = str8_skip(rhs->string, 1); + RD_CfgID id = u64_from_str8(numeric_part, 16); + RD_Cfg *cfg = rd_cfg_from_id(id); + E_Space space = rd_eval_space_from_cfg(cfg); + result.root = e_irtree_set_space(arena, space, e_irtree_const_u(arena, 0)); + result.type_key = e_string2typekey_map_lookup(rd_state->meta_name2type_map, cfg->string); + result.mode = E_Mode_Offset; + } + return result; +} + //////////////////////////////// //~ rjf: Config Collection Type Hooks @@ -626,7 +647,7 @@ struct RD_CfgsIRExt Rng1U64 cfgs_idx_range; }; -E_TYPE_IREXT_FUNCTION_DEF(cfgs) +E_TYPE_IREXT_FUNCTION_DEF(cfgs_slice) { RD_CfgsIRExt *ext = push_array(arena, RD_CfgsIRExt, 1); { @@ -666,7 +687,7 @@ E_TYPE_IREXT_FUNCTION_DEF(cfgs) return result; } -E_TYPE_ACCESS_FUNCTION_DEF(cfgs) +E_TYPE_ACCESS_FUNCTION_DEF(cfgs_slice) { E_IRTreeAndType result = {&e_irnode_nil}; RD_Cfg *cfg = &rd_nil_cfg; @@ -712,7 +733,7 @@ struct RD_CfgsExpandAccel Rng1U64 cfgs_idx_range; }; -E_TYPE_EXPAND_INFO_FUNCTION_DEF(cfgs) +E_TYPE_EXPAND_INFO_FUNCTION_DEF(cfgs_slice) { RD_CfgsExpandAccel *accel = push_array(arena, RD_CfgsExpandAccel, 1); E_TypeExpandInfo info = {accel}; @@ -754,7 +775,7 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(cfgs) return info; } -E_TYPE_EXPAND_RANGE_FUNCTION_DEF(cfgs) +E_TYPE_EXPAND_RANGE_FUNCTION_DEF(cfgs_slice) { RD_CfgsExpandAccel *accel = (RD_CfgsExpandAccel *)user_data; Rng1U64 cmds_idx_range = accel->cmds_idx_range; @@ -781,12 +802,12 @@ E_TYPE_EXPAND_RANGE_FUNCTION_DEF(cfgs) for(U64 idx = 0; idx < read_count; idx += 1, dst_idx += 1) { RD_Cfg *cfg = accel->cfgs.v[idx + read_range.min - cfgs_idx_range.min]; - evals_out[dst_idx] = e_eval_from_stringf("$%I64x", cfg->id); + evals_out[dst_idx] = e_eval_from_stringf("query:config.$%I64x", cfg->id); } } } -E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_DEF(cfgs) +E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_DEF(cfgs_slice) { U64 id = 0; RD_CfgsExpandAccel *accel = (RD_CfgsExpandAccel *)user_data; @@ -807,7 +828,7 @@ E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_DEF(cfgs) return id; } -E_TYPE_EXPAND_NUM_FROM_ID_FUNCTION_DEF(cfgs) +E_TYPE_EXPAND_NUM_FROM_ID_FUNCTION_DEF(cfgs_slice) { U64 num = 0; RD_CfgsExpandAccel *accel = (RD_CfgsExpandAccel *)user_data; diff --git a/src/raddbg/raddbg_eval.h b/src/raddbg/raddbg_eval.h index 2c01a48e..91295bea 100644 --- a/src/raddbg/raddbg_eval.h +++ b/src/raddbg/raddbg_eval.h @@ -40,14 +40,19 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(schema); E_TYPE_EXPAND_RANGE_FUNCTION_DEF(schema); //////////////////////////////// -//~ rjf: Config Collection Type Hooks +//~ rjf: Config Type Hooks -E_TYPE_IREXT_FUNCTION_DEF(cfgs); E_TYPE_ACCESS_FUNCTION_DEF(cfgs); -E_TYPE_EXPAND_INFO_FUNCTION_DEF(cfgs); -E_TYPE_EXPAND_RANGE_FUNCTION_DEF(cfgs); -E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_DEF(cfgs); -E_TYPE_EXPAND_NUM_FROM_ID_FUNCTION_DEF(cfgs); + +//////////////////////////////// +//~ rjf: Config Slice Type Hooks + +E_TYPE_IREXT_FUNCTION_DEF(cfgs_slice); +E_TYPE_ACCESS_FUNCTION_DEF(cfgs_slice); +E_TYPE_EXPAND_INFO_FUNCTION_DEF(cfgs_slice); +E_TYPE_EXPAND_RANGE_FUNCTION_DEF(cfgs_slice); +E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_DEF(cfgs_slice); +E_TYPE_EXPAND_NUM_FROM_ID_FUNCTION_DEF(cfgs_slice); //////////////////////////////// //~ rjf: `call_stack` Type Hooks diff --git a/src/raddbg/raddbg_views.c b/src/raddbg/raddbg_views.c index 92e44178..d16f4b58 100644 --- a/src/raddbg/raddbg_views.c +++ b/src/raddbg/raddbg_views.c @@ -1060,7 +1060,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row) //////////////////////////// //- rjf: fill row's group cfg // - if(info.group_cfg_name.size != 0 && (block_type->expand.id_from_num == E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(cfgs) || + if(info.group_cfg_name.size != 0 && (block_type->expand.id_from_num == E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(cfgs_slice) || block_type->expand.id_from_num == E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(watches) || block_type->expand.id_from_num == E_TYPE_EXPAND_ID_FROM_NUM_FUNCTION_NAME(environment))) { diff --git a/src/raddbg/raddbg_widgets.c b/src/raddbg/raddbg_widgets.c index fe5eb327..a8184f78 100644 --- a/src/raddbg/raddbg_widgets.c +++ b/src/raddbg/raddbg_widgets.c @@ -1644,7 +1644,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe { rd_cmd(RD_CmdKind_PushQuery, .ui_key = bp_box->key, - .expr = push_str8f(scratch.arena, "$%I64x", bp->id)); + .expr = push_str8f(scratch.arena, "query:config.$%I64x", bp->id)); } // rjf: shift+click => enable breakpoint @@ -1701,7 +1701,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe { rd_cmd(RD_CmdKind_PushQuery, .ui_key = pin_box->key, - .expr = push_str8f(scratch.arena, "$%I64x", pin->id)); + .expr = push_str8f(scratch.arena, "query:config.$%I64x", pin->id)); } // rjf: click => remove pin