fix flipped interpretation of scope address ranges in dwarf - address class implies opl, not size

This commit is contained in:
Ryan Fleury
2026-06-19 12:41:17 -07:00
parent 3b22b1f13e
commit 9f82a6fe91
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -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;
+2 -2
View File
@@ -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<<DW_AttribClass_Address))
{
voff_opl = voff_base + hipc_attrib->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});
}