From 51b8dbaab063a03963f9fde208c9948de86beedf Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 10 Oct 2024 14:06:52 -0700 Subject: [PATCH] fix incorrect registers view with new eval viz expansion system --- src/raddbg/raddbg_core.c | 24 ++++++++++++++++++++---- src/raddbg/raddbg_main.c | 20 +++++++++++--------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index fde644fb..9ab7688f 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -8554,18 +8554,34 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(locals) EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(registers) { + Temp scratch = scratch_begin(&arena, 1); CTRL_Entity *thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->thread); Arch arch = thread->arch; U64 reg_count = regs_reg_code_count_from_arch(arch); U64 alias_count = regs_alias_code_count_from_arch(arch); String8 *reg_strings = regs_reg_code_string_table_from_arch(arch); String8 *alias_strings = regs_alias_code_string_table_from_arch(arch); + String8List exprs_list = {0}; + for(U64 idx = 1; idx < reg_count; idx += 1) + { + FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, reg_strings[idx]); + if(matches.count == matches.needle_part_count) + { + str8_list_push(scratch.arena, &exprs_list, reg_strings[idx]); + } + } + for(U64 idx = 1; idx < alias_count; idx += 1) + { + FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, alias_strings[idx]); + if(matches.count == matches.needle_part_count) + { + str8_list_push(scratch.arena, &exprs_list, alias_strings[idx]); + } + } String8Array *accel = push_array(arena, String8Array, 1); - accel->count = reg_count + alias_count; - accel->v = push_array(arena, String8, accel->count); - MemoryCopy(accel->v + 0, reg_strings, reg_count); - MemoryCopy(accel->v + reg_count, alias_strings, alias_count); + *accel = str8_array_from_list(arena, &exprs_list); EV_ExpandInfo info = {accel, accel->count}; + scratch_end(scratch); return info; } diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index e5cb3e9b..b1922892 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.c @@ -8,26 +8,17 @@ // [ ] entity listers - kill-specific-process, etc. // [ ] new universal ctx menu, hover, tooltips systems // [ ] fix memory view -// [ ] meta eval system -// [ ] file path map editor -// [ ] file path map building // [ ] `switch` replacement (recent files history) // [ ] resolving name as file or #include // [ ] new `restart processes` path // [ ] remainder of @msgs // // [ ] post-@msgs TODOs: -// [ ] ensure "prefer_disasm" is calculated correctly - disassembly-focused -// stepping -// // [ ] ensure the following issues are resolved with this new pass: // [ ] global evaluation across DLL boundaries // [ ] mohit-reported callstack-frame-selection bug (with inlines) // [ ] empty user file causing failure to launch // [ ] decay arrays to pointers in pointer/value comparison -// [ ] file overrides -> always pick most specific one! found with conflicting -// overrides, e.g. C:/devel/ -> D:/devel/, but also C:/devel/foo -> -// C:/devel/bar, etc. // [ ] visualize all breakpoints everywhere - source view should show up in // disasm, disasm should show up in source view, function should show up in // both, etc. @@ -37,6 +28,8 @@ // that's because there was a function breakpoint there. // [ ] debugger readme pass // +// +// // [x] codebase readme pass // [x] target editor // [x] modules view @@ -55,6 +48,10 @@ // [x] ensure ctrl+click // [x] scheduler view // [x] eval committing +// [x] fix registers +// [x] file overrides -> always pick most specific one! found with conflicting +// overrides, e.g. C:/devel/ -> D:/devel/, but also C:/devel/foo -> +// C:/devel/bar, etc. //////////////////////////////// //~ rjf: post-0.9.12 TODO notes @@ -523,6 +520,11 @@ // all of the stateful windows/panel/view/watch mechanisms, and then // the frontend pure-functionally queries stuff like os/r handles // on-demand, and then prunes them, immediate-mode cache style. +// [x] ensure "prefer_disasm" is calculated correctly - disassembly-focused +// stepping +// [x] file path map editor +// [x] file path map building +// [x] meta eval system //////////////////////////////// //~ rjf: Build Options