summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-12-04 11:45:21 -0500
committerJosh Ferrell <josh@vector35.com>2024-12-04 11:45:21 -0500
commita03219926d8797bc57cb87339a3994faf30a44fa (patch)
tree6d47f24591744f5340478b688a6b7df70c44e8d0
parent815c3fa9cd3334bdc010a07db431735b49c71546 (diff)
Add support for DW_OP_addrx lookups for data variables
-rw-r--r--rust/examples/dwarf/dwarf_import/src/types.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/types.rs b/rust/examples/dwarf/dwarf_import/src/types.rs
index bfc7b17d..4914b501 100644
--- a/rust/examples/dwarf/dwarf_import/src/types.rs
+++ b/rust/examples/dwarf/dwarf_import/src/types.rs
@@ -61,6 +61,17 @@ pub(crate) fn parse_variable<R: ReaderType>(
debug_info_builder.add_data_variable(address, full_name, uid)
}
},
+ Ok(Operation::AddressIndex { index }) => {
+ if let Some(uid) = type_uid {
+ if let Ok(address) = dwarf.address(unit, index) {
+ debug_info_builder.add_data_variable(address, full_name, uid)
+ }
+ else
+ {
+ warn!("Invalid index into IAT: {}", index.0);
+ }
+ }
+ },
Ok(op) => {
debug!("Unhandled operation type for variable: {:?}", op);
},