pub struct DebugSections { /* private fields */ }
Expand description

The set of debug sections that we need to use from a crate object file.

All debug sections herein are contained within a single MappedPages memory region.

Implementations§

source§

impl DebugSections

source

pub fn debug_str(&self) -> DebugStr<EndianSlice<'_, NativeEndian>>

Returns the ".debug_str" section.

source

pub fn debug_loc(&self) -> Option<DebugLoc<EndianSlice<'_, NativeEndian>>>

Returns the ".debug_loc" section.

source

pub fn debug_abbrev(&self) -> DebugAbbrev<EndianSlice<'_, NativeEndian>>

Returns the ".debug_abbrev" section.

source

pub fn debug_info(&self) -> DebugInfo<EndianSlice<'_, NativeEndian>>

Returns the ".debug_info" section.

source

pub fn debug_ranges(&self) -> DebugRanges<EndianSlice<'_, NativeEndian>>

Returns the ".debug_ranges" section.

source

pub fn debug_pubnames(&self) -> DebugPubNames<EndianSlice<'_, NativeEndian>>

Returns the ".debug_pubnames" section.

source

pub fn debug_pubtypes(&self) -> DebugPubTypes<EndianSlice<'_, NativeEndian>>

Returns the ".debug_pubtypes" section.

source

pub fn debug_line(&self) -> DebugLine<EndianSlice<'_, NativeEndian>>

Returns the ".debug_line" section.

source

pub fn find_subprogram_containing( &self, instruction_pointer: VirtualAddress ) -> Result<Option<DebugInfoOffset>>

Finds the subprogram that contains the given instruction pointer.

A subprogram is DWARF’s term for an executable function/method/closure/subroutine, which has a bounded range of program counters / instruction pointers that can be searched.

Return

Returns the offset into the DebugInfo of the Debugging Information Entry (DIE) that describes the subprogram that covers (includes) the virtual address of the given instruction_pointer.

If a matching subprogram DIE is not found, Ok(None) is returned.

Otherwise, an error is returned upon failure, e.g., a problem parsing the debug sections.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.