Browse Source
This commit is a fix to Wasmtime's DWARF processing transform to correct the meaning of the `.debug_loc` section. This section's addresses are relative to the `DW_AT_low_pc` entry located in the `DW_TAG_compile_unit` container, but Wasmtime's construction of this section didn't take this into account. Instead all addresses in `.debug_loc` are relative to the start of the compiled object, not to the start of the compile unit itself. This commit fixes this by unconditionally describing `DW_TAG_compile_unit` locations with `DW_AT_ranges` instead of `DW_AT_low_pc`. This ends up fixing debug information for debug information using `.debug_loc` with multiple codegen units. Closes #8752pull/8770/head
Alex Crichton
5 months ago
committed by
GitHub
3 changed files with 70 additions and 1 deletions
@ -0,0 +1,14 @@ |
|||
fn main() { |
|||
let a = 3; |
|||
foo::bar(a); |
|||
} |
|||
|
|||
mod foo { |
|||
pub fn bar(x: u32) -> u32 { |
|||
let mut sum = 0; |
|||
for i in 0..x { |
|||
sum += i; |
|||
} |
|||
sum |
|||
} |
|||
} |
Loading…
Reference in new issue