Display correct line numbers for multiple .text sections (#63)

* Support multiple DWARF sequences

* Rework DWARF line info parsing

- Properly handles multiple sections
  in DWARF 1
- line_info moved into ObjSection
- DWARF 2 parser no longer errors with
  no .text section
- Both parsers properly skip empty
  sections

* Simplify line_info (no Option)

---------

Co-authored-by: Luke Street <luke.street@encounterpc.com>
This commit is contained in:
Aetias
2024-05-21 17:55:39 +02:00
committed by GitHub
parent 22a24f37f5
commit f5b5a612fc
5 changed files with 71 additions and 42 deletions

View File

@@ -112,10 +112,7 @@ impl ObjArch for ObjArchMips {
}
}
}
let line = obj
.line_info
.as_ref()
.and_then(|map| map.range(..=cur_addr as u64).last().map(|(_, &b)| b));
let line = section.line_info.range(..=cur_addr as u64).last().map(|(_, &b)| b);
insts.push(ObjIns {
address: cur_addr as u64,
size: 4,