Refactor address_transform.rs to use less memory (#1260)

The crates/debug/src/transform/address_transform.rs is unoptimized in terms of data structures. This PR refactors this file to remove creation of intermediate in-heap structures, thus improves overall performance of the DWARF transformation.

* Reduce amount of memory allocated in translate_ranges_raw
* refactor translate_ranges
* Don't transform non-unit .debug_line
* type annotation for TransformRangeXXXIter's
* Fix empty generated wasm positions
This commit is contained in:
Yury Delendik
2020-03-23 16:36:29 -05:00
committed by GitHub
parent 2fdc7f1a8e
commit 021ebb3748
4 changed files with 233 additions and 89 deletions

View File

@@ -358,8 +358,7 @@ pub fn generate_simulated_dwarf(
write::AttributeValue::StringRef(name_id),
);
let f = addr_tr.map().get(i).unwrap();
let f_start = f.addresses[0].wasm;
let f_start = map.addresses[0].wasm;
let wasm_offset = di.wasm_file.code_section_offset + f_start as u64;
die.set(
gimli::DW_AT_decl_file,