diff options
| author | Josh Ferrell <josh@vector35.com> | 2024-06-17 15:41:56 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2024-06-17 15:48:06 -0400 |
| commit | 7fe90070052c19d174585e7152ba66f3057328e7 (patch) | |
| tree | 33c4e3131742efb297f8018041776dac9a804130 /rust | |
| parent | a29b3227ded18cf7f8e0e31968d410eeb99dd8e3 (diff) | |
Load all types from DWARF even if they are unused
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/examples/dwarf/dwarf_import/src/lib.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs index 62b8c18a..1b6420a2 100644 --- a/rust/examples/dwarf/dwarf_import/src/lib.rs +++ b/rust/examples/dwarf/dwarf_import/src/lib.rs @@ -227,11 +227,19 @@ fn parse_unit<R: Reader<Offset = usize>>( constants::DW_TAG_subprogram => { let fn_idx = parse_function_entry(unit, entry, debug_info_builder_context, debug_info_builder); functions_by_depth.push((fn_idx, current_depth)); - } + }, constants::DW_TAG_variable => { let current_fn_idx = functions_by_depth.last().and_then(|x| x.0); parse_variable(unit, entry, debug_info_builder_context, debug_info_builder, current_fn_idx) - } + }, + constants::DW_TAG_class_type | + constants::DW_TAG_enumeration_type | + constants::DW_TAG_structure_type | + constants::DW_TAG_union_type | + constants::DW_TAG_typedef => { + // Ensure types are loaded even if they're unused + types::get_type(unit, entry, debug_info_builder_context, debug_info_builder); + }, _ => (), } } |
