Skip to content

Commit

Permalink
Merge pull request #416 from philipc/section-id
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
philipc authored Apr 16, 2019
2 parents 053f9e3 + ee93780 commit 1bcc823
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion examples/dwarfdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,18 @@ where
let out = io::stdout();
writeln!(&mut BufWriter::new(out.lock()), "\n.debug_info")?;

let units = dwarf.units().collect::<Vec<_>>().unwrap();
let units = match dwarf.units().collect::<Vec<_>>() {
Ok(units) => units,
Err(err) => {
writeln_error(
&mut BufWriter::new(out.lock()),
dwarf,
Error::GimliError(err),
"Failed to read unit headers",
)?;
return Ok(());
}
};
let process_unit = |header: CompilationUnitHeader<R>, buf: &mut Vec<u8>| -> Result<()> {
writeln!(
buf,
Expand Down
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub enum UnitSectionOffset<T = usize> {
}

/// An identifier for a DWARF section.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)]
pub enum SectionId {
/// The `.debug_abbrev` section.
DebugAbbrev,
Expand Down

0 comments on commit 1bcc823

Please sign in to comment.