Skip to content

Commit 7fe9007

Browse files
committed
Load all types from DWARF even if they are unused
1 parent a29b322 commit 7fe9007

File tree

1 file changed

+10
-2
lines changed
  • rust/examples/dwarf/dwarf_import/src

1 file changed

+10
-2
lines changed

rust/examples/dwarf/dwarf_import/src/lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,19 @@ fn parse_unit<R: Reader<Offset = usize>>(
227227
constants::DW_TAG_subprogram => {
228228
let fn_idx = parse_function_entry(unit, entry, debug_info_builder_context, debug_info_builder);
229229
functions_by_depth.push((fn_idx, current_depth));
230-
}
230+
},
231231
constants::DW_TAG_variable => {
232232
let current_fn_idx = functions_by_depth.last().and_then(|x| x.0);
233233
parse_variable(unit, entry, debug_info_builder_context, debug_info_builder, current_fn_idx)
234-
}
234+
},
235+
constants::DW_TAG_class_type |
236+
constants::DW_TAG_enumeration_type |
237+
constants::DW_TAG_structure_type |
238+
constants::DW_TAG_union_type |
239+
constants::DW_TAG_typedef => {
240+
// Ensure types are loaded even if they're unused
241+
types::get_type(unit, entry, debug_info_builder_context, debug_info_builder);
242+
},
235243
_ => (),
236244
}
237245
}

0 commit comments

Comments
 (0)