fix(dwarf): remap DW_AT_location lists to the fused layout (#319 inc 3) — --verify CLEAN#322
Conversation
LS-N verification gate✅ 58/58 approved LS entries verified
Approved Failed LS entries(none) Missing regression tests(none) Updated automatically by |
Mythos delta-pass (auto)✅ NO FINDINGS across 1 Tier-5 file(s)
Auto-run via |
Mythos delta-pass — NO FINDINGS (meld-core/src/dwarf.rs)
Oracle: freshly-built binary → |
Final increment — takes the fused DWARF to llvm-dwarfdump --verify clean. The residual Invalid DW_AT_location / Invalid DWARF expressions were the same base-relative-offset bug as inc 2, in .debug_loc location lists. Fix: correct_die_locations (the correct_die_ranges analogue) rebuilds each list from the read side, translating entry endpoints and carrying the location expression bytes verbatim; unmappable entries dropped, emptied list deletes the attribute (LS-D-1). records-only + records+variants both -> No errors (cumulative #319: 1049 -> 0). Test: inc3_location_list_ranges_stay_in_module. Refs: #319. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61b078d to
3c075ac
Compare
What
Final increment for #319 — takes the fused DWARF to
llvm-dwarfdump --verifyclean (No errors.).Stacks on #320 (inc 1, merged) + #321 (inc 2). The residual "Invalid DW_AT_location" / "Invalid DWARF expressions" errors were the same base-relative-offset bug as inc 2, in
.debug_loclocation lists: gimli mis-routes each entry's begin/end (base-relative offsets) throughconvert_address→ garbage ranges (e.g.[0x905993c0,…)) which, with the0xFFFFFFFF/0xFFFFFFFEsentinels, derail the list decode.Fix
correct_die_locations— thecorrect_die_rangesanalogue for location lists: resolve each list from the read side (attr_locations, base applied),translatethe entry endpoints to the fused layout, re-emit asLocation::OffsetPairrelative to the output CU base, carrying the location expression bytes verbatim (WASM location exprs —DW_OP_WASM_location/DW_OP_stack_value— hold no code addresses; a dataDW_OP_addris unchanged under fusion, matchingconvert_address's data passthrough). Bare exprloc locations aren't lists (attr_locations→None) and are left to gimli. Unmappable entries dropped; emptied list deletesDW_AT_location(LS-D-1).Effect — #319 complete
No errors.records-only likewise →
No errors.Test
inc3_location_list_ranges_stay_in_module— fusesrecords.wasm, asserts everyDW_AT_locationlist entry's range lies within the fused module (the ~2.4 GiB garbage begin failed before). 3 witness/inc2/inc3 + 24 dwarf unit tests pass.Refs: #319.
🤖 Generated with Claude Code