From d6946973f49e6d6b181ed0efb6d40c23c8afdb7d Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Tue, 8 Oct 2024 14:22:06 -0400 Subject: Add support for zstd compressed DWARF, simplify handling of zlib compressed DWARF, improve DWARF error handling --- rust/examples/dwarf/dwarf_import/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'rust/examples/dwarf/dwarf_import/src') 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; } -- cgit v1.3.1