summaryrefslogtreecommitdiff
path: root/rust/examples
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-08-20 11:53:49 -0400
committerJosh Ferrell <josh@vector35.com>2024-08-20 11:53:49 -0400
commit53164c16a6aff903c0eb4ed278cd2168c107f298 (patch)
tree6926b821d7d3ab51c5edeaf6ccff4d81de0f6759 /rust/examples
parent0c93bebaec56154f15d4b4d520860a92523df357 (diff)
DWARF: Recurse through DW_AT_abstract_origin when resolving types
Diffstat (limited to 'rust/examples')
-rw-r--r--rust/examples/dwarf/dwarf_import/src/types.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/types.rs b/rust/examples/dwarf/dwarf_import/src/types.rs
index 35794e36..19b38a90 100644
--- a/rust/examples/dwarf/dwarf_import/src/types.rs
+++ b/rust/examples/dwarf/dwarf_import/src/types.rs
@@ -269,6 +269,29 @@ pub(crate) fn get_type<R: ReaderType>(
None
}
}
+ } else if let Some(die_reference) = get_attr_die(
+ dwarf,
+ unit,
+ entry,
+ debug_info_builder_context,
+ constants::DW_AT_abstract_origin,
+ ) {
+ // This needs to recurse first (before the early return below) to ensure all sub-types have been parsed
+ match die_reference {
+ DieReference::UnitAndOffset((dwarf, entry_unit, entry_offset)) => {
+ get_type(
+ dwarf,
+ entry_unit,
+ &entry_unit.entry(entry_offset).unwrap(),
+ debug_info_builder_context,
+ debug_info_builder,
+ )
+ }
+ DieReference::Err => {
+ warn!("Failed to fetch DIE when getting type through DW_AT_abstract_origin. Debug information may be incomplete.");
+ None
+ }
+ }
} else {
// This needs to recurse first (before the early return below) to ensure all sub-types have been parsed
match resolve_specification(dwarf, unit, entry, debug_info_builder_context) {