From 70ccfd2d8678b2d79ddd996762d4b0889137b65f Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 28 May 2025 13:07:18 -0700 Subject: [PATCH] do greedy ? matching in type pattern matching by default --- src/eval/eval_core.c | 11 ++++++++++- src/raddbg/raddbg_main.c | 35 +++++++---------------------------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/src/eval/eval_core.c b/src/eval/eval_core.c index b782918b..6a370eaf 100644 --- a/src/eval/eval_core.c +++ b/src/eval/eval_core.c @@ -1078,7 +1078,16 @@ e_auto_hook_exprs_from_type_key(Arena *arena, E_TypeKey type_key) { continue; } - U64 pattern_part_pos = str8_find_needle(type_string, scan_pos, n->string, 0); + U64 pattern_part_pos = type_string.size; + for(U64 p = scan_pos; p < type_string.size;) + { + p = str8_find_needle(type_string, p, n->string, 0); + if(p < type_string.size) + { + pattern_part_pos = p; + p += n->string.size; + } + } if(pattern_part_pos > scan_pos && n == auto_hook_node->type_pattern_parts.first) { fits_this_type_string = 0; diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index 9243b825..3c99d889 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.c @@ -2,31 +2,7 @@ // Licensed under the MIT license (https://opensource.org/license/mit/) //////////////////////////////// -//~ rjf: 0.9.18 Release Notes -/* -- Adjusted identifier resolution rules in the evaluation language to prefer visualizer names when used in a call expression. For example, even if you have a variable named `bitmap`, if you evaluate `bitmap(...)`, it will prefer resolving `bitmap` to the visualizer. You can still always disambiguate with qualifiers, e.g. `local:bitmap` or `type:bitmap`. -- Adjusted the `only` view to allow arbitrary derivative expressions, rather than only member names. This allows custom expansions to insert rows for arbitrary expressions. These expressions are derivative from the expanded expression, meaning they can refer to the expanded expression via `$`, or implicitly, its member names. -- Renamed the `table` view to `columns`, and the `only` view to `rows`, since these more directly reflect the way these views are used in the evaluation visualization pipeline. -- Added an option to all text views to scroll to the bottom if the textual content changes at all. Can be used with the `Output` tab. -- Improved toggle switches to allow clicking and dragging to toggle many switches in a single operation. -- The debugger now records the last user file which was loaded while it was opened, and reopens that file on startup, if no user is explicitly specified. (#482) - - The debugger now unfocuses query bars (e.g. that opened by `Ctrl + F` in a source view) if the main view content is clicked by the mouse. The query bar can be refocused also by clicking. - - Moved call stack evaluation to occur asynchronously, so that deeper call stacks (which can be expensive to compute) do not block the UI. - - Stopped the debugger from running the default Windows message handling path for most `Alt`-based keybindings, which was causing a Windows beep sound to play. -- Fixed a bug where RDI files would sometimes fail to generate, resulting in no debug info being available on some runs. - - Fixed a bug which was preventing backslashes from working in file system querying interfaces correctly. - - Fixed a bug which was preventing some recursive call stacks from fully displaying in the debugger. - - Fixed a bug which prevented `Space` from being used as a keybinding. Bound `Space` by default to the `Accept` command (to which `Enter` / `Return` is also defaultly bound). - - Fixed a bug which was preventing conditional breakpoints from correctly being placed, if the condition expression did not evaluate when the debuggees were resumed. - - Fixed the debugger applying too much path processing, which was causing relative paths in debug info to be interpreted incorrectly. The debugger should now work much better with relative paths (e.g. produced via `/d1trimfile`). In these cases, the debugger may still not be able to fully compute the correct absolute paths, because this information is not stored within debug information. But once the debugger is redirected to the correct file once through the UI, it should work with relative paths correctly. - - If the debugger crashes, the message box which opens and displays the crash call stack now also allows the creation of crash dump files. Please submit these, if possible, with crash reports; it will help us to debug crashes more effectively. - - Fixed a bug which was causing text rendering to fail both when running the debugger on WINE and also on Windows 7. -- Fixed a bug where exception information inlined in source code would overlap the source code text. -- The debugger now correctly correctly interprets relative per-target `stdout`, `stderr`, and `stdin` paths. -*/ - -//////////////////////////////// -//~ rjf: post-0.9.16 TODO notes +//~ rjf: post-0.9.19 TODO notes // //- watch improvements // [ ] *ALL* expressions in watch windows need to be editable. @@ -37,14 +13,14 @@ // [ ] back/forward, using cfg wins // [ ] mouse back button should make view to go back after I double clicked // on function to open it +// [ ] expand %environment_variables% in target environment strings - is there +// a way we can defer to the underlying shell in a non-horrible way...? // //- stepping or breakpoint oddness/fixes // [ ] stepping-onto a line with a conditional breakpoint, which fails, causes a // single step over the first instruction of that line, even if the thread // would've stopped at the first instruction due to the step, were that bp not // there. -// [ ] if a breakpoint matches the entry point's starting address, its hit count -// is not correctly incremented. // [ ] breakpoints in optimized code? maybe early-terminating bp resolution loop? @bpmiss // - actually this seems to be potentially because of incomplete src-line-map info... // [ ] Mohit-reported breakpoint not hitting - may be similar thing to @bpmiss @@ -109,7 +85,6 @@ //- visualizer improvements // [ ] disasm starting address - need to use debug info for more correct results... // [ ] linked list view -// [ ] output: add option for scroll-to-bottom - ensure this shows up in universal ctx menu // [ ] multidimensional `array` // [ ] 2-vector, 3-vector, quaternion // [ ] audio waveform views @@ -186,6 +161,10 @@ //////////////////////////////// //~ rjf: Recently Completed Task Log +// +// [x] if a breakpoint matches the entry point's starting address, its hit count +// is not correctly incremented. +// [x] output: add option for scroll-to-bottom - ensure this shows up in universal ctx menu //////////////////////////////// //~ rjf: Build Options