From 9f82a6fe911b60616676b0e4e1f0baca05badac1 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Fri, 19 Jun 2026 12:41:17 -0700 Subject: [PATCH] fix flipped interpretation of scope address ranges in dwarf - address class implies opl, not size --- src/radbin/radbin.c | 7 ++++++- src/rdi_from_dwarf/rdi_from_dwarf.c | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/radbin/radbin.c b/src/radbin/radbin.c index 24d21823..ddf9c9ef 100644 --- a/src/radbin/radbin.c +++ b/src/radbin/radbin.c @@ -1137,13 +1137,18 @@ rb_thread_entry_point(void *p) RDI_Scope *root_scope = rdi_element_from_name_idx(rdi, Scopes, proc->root_scope_idx); if(root_scope->voff_range_opl > root_scope->voff_range_first) { + // rjf: dump function record RDIM_Rng1U64 voff_range = { *rdi_element_from_name_idx(rdi, ScopeVOffData, root_scope->voff_range_first), *rdi_element_from_name_idx(rdi, ScopeVOffData, root_scope->voff_range_opl - 1), }; - str8_list_pushf(arena, out, "FUNC %I64x %I64x %I64x %S\n", voff_range.min, voff_range.max-voff_range.min, 0ull, str8_from_rdi_string_idx(rdi, proc->name_string_idx)); + { + Temp scratch = scratch_begin(0, 0); + str8_list_pushf(arena, out, "FUNC %I64x %I64x %I64x %S\n", voff_range.min, voff_range.max-voff_range.min, 0ull, fully_qualified_str8_from_rdi_symbol(scratch.arena, rdi, proc)); + scratch_end(scratch); + } // rjf: dump function lines U64 unit_vmap_count = 0; diff --git a/src/rdi_from_dwarf/rdi_from_dwarf.c b/src/rdi_from_dwarf/rdi_from_dwarf.c index f0a3a07a..b7412885 100644 --- a/src/rdi_from_dwarf/rdi_from_dwarf.c +++ b/src/rdi_from_dwarf/rdi_from_dwarf.c @@ -3080,11 +3080,11 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params) U64 voff_opl = 0; if(dw_attrib_class_from_form_kind(unit_parse_ctx->version, unit_parse_ctx->exts, hipc_attrib->val.kind) & (1<val.u128.u64[0]; + voff_opl = hipc_attrib->val.addr; } else { - voff_opl = hipc_attrib->val.addr; + voff_opl = voff_base + hipc_attrib->val.u128.u64[0]; } rdim_rng1u64_list_push(arena, &ranges, (RDIM_Rng1U64){voff_base, voff_opl}); }