From 47373fbb5857250aef9e5e642adbbb235e26be42 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Sat, 4 Jan 2025 17:02:46 -0800 Subject: [PATCH] prioritize exe-relative debug paths - treat embedded pdb/rdi paths as relative to the exe first - if they are relative, then relative to the exe is the correct choice, but if they are absolute, then it will simply be an invalid path, and so it will just pick up the full absolute embedded pdb path on the next candidate. --- src/ctrl/ctrl_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ctrl/ctrl_core.c b/src/ctrl/ctrl_core.c index 224d5153..80944eb3 100644 --- a/src/ctrl/ctrl_core.c +++ b/src/ctrl/ctrl_core.c @@ -3667,13 +3667,13 @@ ctrl_thread__module_open(CTRL_Handle process, CTRL_Handle module, Rng1U64 vaddr_ String8List dbg_path_candidates = {0}; if(rdi_dbg_path.size != 0) { - str8_list_push(scratch.arena, &dbg_path_candidates, rdi_dbg_path); str8_list_pushf(scratch.arena, &dbg_path_candidates, "%S/%S", exe_folder, rdi_dbg_path); + str8_list_push(scratch.arena, &dbg_path_candidates, rdi_dbg_path); } if(pdb_dbg_path.size != 0) { - str8_list_push(scratch.arena, &dbg_path_candidates, pdb_dbg_path); str8_list_pushf(scratch.arena, &dbg_path_candidates, "%S/%S", exe_folder, pdb_dbg_path); + str8_list_push(scratch.arena, &dbg_path_candidates, pdb_dbg_path); } str8_list_pushf(scratch.arena, &dbg_path_candidates, "%S.pdb", str8_chop_last_dot(path)); str8_list_pushf(scratch.arena, &dbg_path_candidates, "%S.pdb", path);