Struct gimli::read::DwarfPackage

source ·
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: R

An empty section.

Used when creating Dwarf<R>.

Implementations§

source§

impl<R: Reader> DwarfPackage<R>

source

pub fn load<F, E>(section: F, empty: R) -> Result<Self, E>
where F: FnMut(SectionId) -> Result<R, E>, E: From<Error>,

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.

source

fn from_sections(sections: DwarfPackageSections<R>, empty: R) -> Result<Self>

Create a DwarfPackage structure from the given sections.

source

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`.
}
source

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.

source

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.

source

pub fn tu_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..tu_index.unit_count.

This function should only be needed by low level parsers.

source

pub fn sections( &self, sections: UnitIndexSectionIterator<'_, R>, parent: &Dwarf<R>, ) -> Result<Dwarf<R>>

Return the section contributions of a unit.

This function should only be needed by low level parsers.

Trait Implementations§

source§

impl<R: Debug + Reader> Debug for DwarfPackage<R>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> Freeze for DwarfPackage<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for DwarfPackage<R>
where R: RefUnwindSafe,

§

impl<R> Send for DwarfPackage<R>
where R: Send,

§

impl<R> Sync for DwarfPackage<R>
where R: Sync,

§

impl<R> Unpin for DwarfPackage<R>
where R: Unpin,

§

impl<R> UnwindSafe for DwarfPackage<R>
where R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.