Skip to content

Commit

Permalink
Merge pull request gimli-rs#526 from khuey/dwarfdump-index-display
Browse files Browse the repository at this point in the history
Display indexes for the various index attribute types.
  • Loading branch information
philipc authored Jul 7, 2020
2 parents 6597ad2 + d1b4990 commit f0ddbab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/dwarfdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ fn dump_attr_value<R: Reader, W: Write>(
writeln!(w, "<.debug_addr+0x{:08x}>", base.0)?;
}
gimli::AttributeValue::DebugAddrIndex(index) => {
write!(w, "(indirect address, index {:#x}): ", index.0)?;
let address = dwarf.address(unit, index)?;
writeln!(w, "0x{:08x}", address)?;
}
Expand Down Expand Up @@ -1215,6 +1216,7 @@ fn dump_attr_value<R: Reader, W: Write>(
writeln!(w, "<.debug_loclists+0x{:08x}>", base.0)?;
}
gimli::AttributeValue::DebugLocListsIndex(index) => {
write!(w, "(indirect location list, index {:#x}): ", index.0)?;
let offset = dwarf.locations_offset(unit, index)?;
dump_loc_list(w, offset, unit, dwarf)?;
}
Expand All @@ -1231,6 +1233,7 @@ fn dump_attr_value<R: Reader, W: Write>(
writeln!(w, "<.debug_rnglists+0x{:08x}>", base.0)?;
}
gimli::AttributeValue::DebugRngListsIndex(index) => {
write!(w, "(indirect range list, index {:#x}): ", index.0)?;
let offset = dwarf.ranges_offset(unit, index)?;
dump_range_list(w, offset, unit, dwarf)?;
}
Expand All @@ -1252,6 +1255,7 @@ fn dump_attr_value<R: Reader, W: Write>(
writeln!(w, "<.debug_str_offsets+0x{:08x}>", base.0)?;
}
gimli::AttributeValue::DebugStrOffsetsIndex(index) => {
write!(w, "(indirect string, index {:#x}): ", index.0)?;
let offset = dwarf.debug_str_offsets.get_str_offset(
unit.encoding().format,
unit.str_offsets_base,
Expand Down

0 comments on commit f0ddbab

Please sign in to comment.