summaryrefslogtreecommitdiff
path: root/rust/examples/dwarf/dwarf_import/src
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-10-08 14:22:06 -0400
committerJosh Ferrell <josh@vector35.com>2024-10-08 14:22:06 -0400
commitd6946973f49e6d6b181ed0efb6d40c23c8afdb7d (patch)
tree3fa1a1af0a44aaf5fead1cc38a69b995d91f6d9c /rust/examples/dwarf/dwarf_import/src
parenta81692cde97ba3a0b51b5fc43d2680a973a0e329 (diff)
Add support for zstd compressed DWARF, simplify handling of zlib compressed DWARF, improve DWARF error handling
Diffstat (limited to 'rust/examples/dwarf/dwarf_import/src')
-rw-r--r--rust/examples/dwarf/dwarf_import/src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs
index 114084a1..13c18a8c 100644
--- a/rust/examples/dwarf/dwarf_import/src/lib.rs
+++ b/rust/examples/dwarf/dwarf_import/src/lib.rs
@@ -385,7 +385,15 @@ fn parse_dwarf(
let endian = get_endian(view);
let mut section_reader =
|section_id: SectionId| -> _ { create_section_reader(section_id, view, endian, dwo_file) };
- let mut dwarf = Dwarf::load(&mut section_reader).unwrap();
+
+ let mut dwarf = match Dwarf::load(&mut section_reader) {
+ Ok(x) => x,
+ Err(e) => {
+ error!("Failed to load DWARF info: {}", e);
+ return Err(());
+ }
+ };
+
if dwo_file {
dwarf.file_type = DwarfFileType::Dwo;
}