diff options
| author | KyleMiles <krm504@nyu.edu> | 2023-08-22 13:01:09 -0400 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2023-08-22 13:01:09 -0400 |
| commit | 5b73fb82d272aa32ff124a69e96579679e7d3580 (patch) | |
| tree | 182844e264b4c9ae5727a9a1c86aa7bf0fd462aa /rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs | |
| parent | 02ea8d7309a0c0777ac8a07bfc1e0fd497e9f5f5 (diff) | |
DWARF Import : Improved Cross-Compilation-Unit Handling
Diffstat (limited to 'rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs')
| -rw-r--r-- | rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs b/rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs index fad45f98..7872d8e2 100644 --- a/rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs +++ b/rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs @@ -22,7 +22,7 @@ use binaryninja::{ types::{Conf, FunctionParameter, Type}, }; -use gimli::{DebuggingInformationEntry, Reader, Unit}; +use gimli::{DebuggingInformationEntry, Dwarf, Reader, Unit}; use log::error; use std::{ @@ -210,15 +210,13 @@ impl DebugInfoBuilder { pub fn get_name<R: Reader<Offset = usize>>( &self, + dwarf: &Dwarf<R>, unit: &Unit<R>, entry: &DebuggingInformationEntry<R>, ) -> Option<CString> { - self.names - .get(&get_uid( - unit, - &unit.entry(resolve_specification(unit, entry)).unwrap(), - )) - .cloned() + let (entry_unit, entry_offset) = resolve_specification(dwarf, unit, entry); + let entry = entry_unit.entry(entry_offset).unwrap(); + self.names.get(&get_uid(&entry_unit, &entry)).cloned() } fn commit_types(&self, debug_info: &mut DebugInfo) { |
