addr2line::unit

Struct ResUnits

source
pub(crate) struct ResUnits<R: Reader> {
    ranges: Box<[UnitRange]>,
    units: Box<[ResUnit<R>]>,
}

Fields§

§ranges: Box<[UnitRange]>§units: Box<[ResUnit<R>]>

Implementations§

source§

impl<R: Reader> ResUnits<R>

source

pub(crate) fn parse(sections: &Dwarf<R>) -> Result<Self, Error>

source

pub(crate) fn iter(&self) -> impl Iterator<Item = &ResUnit<R>>

source

pub(crate) fn find_offset( &self, offset: DebugInfoOffset<R::Offset>, ) -> Result<&Unit<R>, Error>

source

pub(crate) fn find(&self, probe: u64) -> impl Iterator<Item = &ResUnit<R>>

Finds the CUs for the function address given.

There might be multiple CUs whose range contains this address. Weak symbols have shown up in the wild which cause this to happen but otherwise this can happen if the CU has non-contiguous functions but only reports a single range.

Consequently we return an iterator for all CUs which may contain the address, and the caller must check if there is actually a function or location in the CU for that address.

source

pub(crate) fn find_range( &self, probe_low: u64, probe_high: u64, ) -> impl Iterator<Item = (&ResUnit<R>, &Range)>

Finds the CUs covering the range of addresses given.

The range is [low, high) (ie, the upper bound is exclusive). This can return multiple ranges for the same unit.

source

pub(crate) fn find_location_range<'a>( &'a self, probe_low: u64, probe_high: u64, sections: &'a Dwarf<R>, ) -> Result<LocationRangeIter<'a, R>, Error>

Auto Trait Implementations§

§

impl<R> Freeze for ResUnits<R>

§

impl<R> !RefUnwindSafe for ResUnits<R>

§

impl<R> Send for ResUnits<R>
where <R as Reader>::Offset: Send, R: Send + Sync,

§

impl<R> !Sync for ResUnits<R>

§

impl<R> Unpin for ResUnits<R>

§

impl<R> UnwindSafe for ResUnits<R>

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.