Struct gimli::read::DwarfPackageSections
source · pub struct DwarfPackageSections<T> {
pub cu_index: DebugCuIndex<T>,
pub tu_index: DebugTuIndex<T>,
pub debug_abbrev: DebugAbbrev<T>,
pub debug_info: DebugInfo<T>,
pub debug_line: DebugLine<T>,
pub debug_str: DebugStr<T>,
pub debug_str_offsets: DebugStrOffsets<T>,
pub debug_loc: DebugLoc<T>,
pub debug_loclists: DebugLocLists<T>,
pub debug_rnglists: DebugRngLists<T>,
pub debug_types: DebugTypes<T>,
}
Expand description
The sections from a .dwp
file.
This is useful for storing sections when T
does not implement Reader
.
It can be used to create a DwarfPackage
that references the data in self
.
If T
does implement Reader
, then use DwarfPackage
directly.
§Example Usage
It can be useful to load DWARF sections into owned data structures,
such as Vec
. However, we do not implement the Reader
trait
for Vec
, because it would be very inefficient, but this trait
is required for all of the methods that parse the DWARF data.
So we first load the DWARF sections into Vec
s, and then use
borrow
to create Reader
s that reference the data.
// Read the DWARF sections into `Vec`s with whatever object loader you're using.
let dwp_sections: gimli::DwarfPackageSections<Vec<u8>> = gimli::DwarfPackageSections::load(loader)?;
// Create references to the DWARF sections.
let dwp: gimli::DwarfPackage<_> = dwp_sections.borrow(
|section| gimli::EndianSlice::new(§ion, gimli::LittleEndian),
gimli::EndianSlice::new(&[], gimli::LittleEndian),
)?;
Fields§
§cu_index: DebugCuIndex<T>
The .debug_cu_index
section.
tu_index: DebugTuIndex<T>
The .debug_tu_index
section.
debug_abbrev: DebugAbbrev<T>
The .debug_abbrev.dwo
section.
debug_info: DebugInfo<T>
The .debug_info.dwo
section.
debug_line: DebugLine<T>
The .debug_line.dwo
section.
debug_str: DebugStr<T>
The .debug_str.dwo
section.
debug_str_offsets: DebugStrOffsets<T>
The .debug_str_offsets.dwo
section.
debug_loc: DebugLoc<T>
The .debug_loc.dwo
section.
Only present when using GNU split-dwarf extension to DWARF 4.
debug_loclists: DebugLocLists<T>
The .debug_loclists.dwo
section.
debug_rnglists: DebugRngLists<T>
The .debug_rnglists.dwo
section.
debug_types: DebugTypes<T>
The .debug_types.dwo
section.
Only present when using GNU split-dwarf extension to DWARF 4.