dbg_engine: instead of sending down relativized breakpoint paths, relativize when resolving breakpoints on ctrl thread per-module - this avoids preference for the selected module, which broke relative file breakpoints without a selected thread in the right module.

This commit is contained in:
Ryan Fleury committed 2026-08-19 11:42:50 -06:00
1 parent 73ba34f354
commit 8a5979a1a6
3 files changed
+30 -31

No files matched your search

+2 -22
View File
@@ -53,7 +53,7 @@ d_breakpoint_array_copy(Arena *arena, D_BreakpointArray *src)
//~ rjf: Path Map Application
internal String8List
d_possible_path_overrides_from_maps_path(Arena *arena, D_Entity *primary_module, D_PathMapArray *path_maps, String8 file_path)
d_possible_path_overrides_from_maps_path(Arena *arena, D_PathMapArray *path_maps, String8 file_path)
{
// NOTE(rjf): This path, given some target file path, scans all file path map
// overrides, and collects the set of file paths which could've redirected
@@ -73,20 +73,6 @@ d_possible_path_overrides_from_maps_path(Arena *arena, D_Entity *primary_module,
PathStyle pth_style = PathStyle_Relative;
String8List pth_parts = path_normalized_list_from_string(scratch.arena, file_path, &pth_style);
//- rjf: push possible overrides by relativizing according to module / debug info
{
String8 module_folder = str8_chop_last_slash(primary_module->string);
String8 path_relative_to_module = path_relative_dst_from_absolute_dst_src(arena, file_path, module_folder);
String8 debug_info_path = d_entity_child_from_kind(primary_module, D_EntityKind_DebugInfoPath)->string;
String8 debug_info_folder = str8_chop_last_slash(debug_info_path);
str8_list_push(arena, &result, path_relative_to_module);
if(!path_match_normalized(debug_info_folder, module_folder))
{
String8 path_relative_to_debug_info = path_relative_dst_from_absolute_dst_src(arena, file_path, debug_info_folder);
str8_list_push(arena, &result, path_relative_to_debug_info);
}
}
//- rjf: push possible overrides based on path map rules
{
for(U64 idx = 0; idx < path_maps->count; idx += 1)
@@ -2190,12 +2176,6 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
d_user_state->ctrl_last_run_param_state_hash = ctrl_param_state_hash;
}
// rjf: unpack target thread/module
D_Entity *thread = d_entity_from_handle(params->thread);
D_Entity *process = d_process_from_entity(thread);
U64 thread_ip_vaddr = d_cached_ip_from_thread(thread->handle);
D_Entity *module = d_module_from_process_vaddr(process, thread_ip_vaddr);
// rjf: push & fill run message
D_Msg *msg = d_msg_list_push(scratch.arena, &ctrl_msgs);
{
@@ -2223,7 +2203,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
// rjf: textual location -> add breakpoints for all possible override locations
if(bp->file_path.size != 0 && bp->pt.line != 0)
{
String8List overrides = d_possible_path_overrides_from_maps_path(scratch.arena, module, path_maps, bp->file_path);
String8List overrides = d_possible_path_overrides_from_maps_path(scratch.arena, path_maps, bp->file_path);
for(String8Node *n = overrides.first; n != 0; n = n->next)
{
D_Breakpoint dst_bp = {0};