Skip to content

Commit

Permalink
Merge pull request #527 from khuey/dwarf5-misc
Browse files Browse the repository at this point in the history
Miscellaneous changes for split-dwarf
  • Loading branch information
philipc authored Jul 7, 2020
2 parents f0ddbab + 7196e09 commit 4e603bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ impl SectionId {
SectionId::DebugAbbrev => ".debug_abbrev.dwo",
SectionId::DebugInfo => ".debug_info.dwo",
SectionId::DebugLine => ".debug_line.dwo",
// The debug_loc section can be present in the dwo when using the
// GNU split-dwarf extension to DWARF4.
SectionId::DebugLoc => ".debug_loc.dwo",
SectionId::DebugLocLists => ".debug_loclists.dwo",
SectionId::DebugMacro => ".debug_macro.dwo",
SectionId::DebugStr => ".debug_str.dwo",
Expand Down
9 changes: 9 additions & 0 deletions src/read/dwarf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,15 @@ impl<R: Reader> Unit<R> {
pub fn entries_raw(&self, offset: Option<UnitOffset<R::Offset>>) -> Result<EntriesRaw<R>> {
self.header.entries_raw(&self.abbreviations, offset)
}

/// Copy attributes that are subject to relocation from another unit. This is intended
/// to be used to copy attributes from a skeleton compilation unit to the corresponding
/// split compilation unit.
pub fn copy_relocated_attributes(&mut self, other: &Unit<R>) {
self.low_pc = other.low_pc;
self.addr_base = other.addr_base;
self.rnglists_base = other.rnglists_base;
}
}

impl<T: ReaderOffset> UnitSectionOffset<T> {
Expand Down

0 comments on commit 4e603bc

Please sign in to comment.