pub struct DwarfPackage<R: Reader> {
pub cu_index: UnitIndex<R>,
pub tu_index: UnitIndex<R>,
pub debug_abbrev: DebugAbbrev<R>,
pub debug_info: DebugInfo<R>,
pub debug_line: DebugLine<R>,
pub debug_str: DebugStr<R>,
pub debug_str_offsets: DebugStrOffsets<R>,
pub debug_loc: DebugLoc<R>,
pub debug_loclists: DebugLocLists<R>,
pub debug_rnglists: DebugRngLists<R>,
pub debug_types: DebugTypes<R>,
pub empty: R,
}Expand description
The sections from a .dwp file, with parsed indices.
Fields§
§cu_index: UnitIndex<R>The compilation unit index in the .debug_cu_index section.
tu_index: UnitIndex<R>The type unit index in the .debug_tu_index section.
debug_abbrev: DebugAbbrev<R>The .debug_abbrev.dwo section.
debug_info: DebugInfo<R>The .debug_info.dwo section.
debug_line: DebugLine<R>The .debug_line.dwo section.
debug_str: DebugStr<R>The .debug_str.dwo section.
debug_str_offsets: DebugStrOffsets<R>The .debug_str_offsets.dwo section.
debug_loc: DebugLoc<R>The .debug_loc.dwo section.
Only present when using GNU split-dwarf extension to DWARF 4.
debug_loclists: DebugLocLists<R>The .debug_loclists.dwo section.
debug_rnglists: DebugRngLists<R>The .debug_rnglists.dwo section.
debug_types: DebugTypes<R>The .debug_types.dwo section.
Only present when using GNU split-dwarf extension to DWARF 4.
empty: RAn empty section.
Used when creating Dwarf<R>.
Implementations§
Source§impl<R: Reader> DwarfPackage<R>
impl<R: Reader> DwarfPackage<R>
Sourcepub fn load<F, E>(section: F, empty: R) -> Result<Self, E>
pub fn load<F, E>(section: F, empty: R) -> Result<Self, E>
Try to load the .dwp sections using the given loader function.
section loads a DWARF section from the object file.
It should return an empty section if the section does not exist.
Sourcepub fn find_cu(&self, id: DwoId, parent: &Dwarf<R>) -> Result<Option<Dwarf<R>>>
pub fn find_cu(&self, id: DwoId, parent: &Dwarf<R>) -> Result<Option<Dwarf<R>>>
Find the compilation unit with the given DWO identifier and return its section contributions.
§Example Usage
if let Some(dwo) = dwp.find_cu(dwo_id, dwarf)? {
let dwo_header = dwo.units().next()?.expect("DWO should have one unit");
let dwo_unit = dwo.unit(dwo_header)?;
// Do something with `dwo_unit`.
}Sourcepub fn find_tu(
&self,
signature: DebugTypeSignature,
parent: &Dwarf<R>,
) -> Result<Option<Dwarf<R>>>
pub fn find_tu( &self, signature: DebugTypeSignature, parent: &Dwarf<R>, ) -> Result<Option<Dwarf<R>>>
Find the type unit with the given type signature and return its section contributions.
Sourcepub fn cu_sections(&self, index: u32, parent: &Dwarf<R>) -> Result<Dwarf<R>>
pub fn cu_sections(&self, index: u32, parent: &Dwarf<R>) -> Result<Dwarf<R>>
Return the section contributions of the compilation unit at the given index.
The index must be in the range 1..cu_index.unit_count.
This function should only be needed by low level parsers.