Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous changes for split-dwarf #527

Merged
merged 2 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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