Struct gimli::read::EhHdrTable

source ·
pub struct EhHdrTable<'a, R: Reader> { /* private fields */ }
Expand description

The CFI binary search table that is an optional part of the .eh_frame_hdr section.

Implementations§

source§

impl<'a, R: Reader + 'a> EhHdrTable<'a, R>

source

pub fn iter<'bases>( &self, bases: &'bases BaseAddresses, ) -> EhHdrTableIter<'_, 'bases, R>

Return an iterator that can walk the .eh_frame_hdr table.

Each table entry consists of a tuple containing an initial_location and address. The initial location represents the first address that the targeted FDE is able to decode. The address is the address of the FDE in the .eh_frame section. The address can be converted with EhHdrTable::pointer_to_offset and EhFrame::fde_from_offset to an FDE.

source

pub fn lookup(&self, address: u64, bases: &BaseAddresses) -> Result<Pointer>

Probably returns a pointer to the FDE for the given address.

This performs a binary search, so if there is no FDE for the given address, this function will return a pointer to any other FDE that’s close by.

To be sure, you must call contains on the FDE.

source

pub fn pointer_to_offset( &self, ptr: Pointer, ) -> Result<EhFrameOffset<R::Offset>>

Convert a Pointer to a section offset.

This does not support indirect pointers.

source

pub fn fde_for_address<F>( &self, frame: &EhFrame<R>, bases: &BaseAddresses, address: u64, get_cie: F, ) -> Result<FrameDescriptionEntry<R>>

Returns a parsed FDE for the given address, or NoUnwindInfoForAddress if there are none.

You must provide a function to get its associated CIE. See PartialFrameDescriptionEntry::parse for more information.

§Example
let table = eh_frame_hdr.table().unwrap();
let fde = table.fde_for_address(&eh_frame, &bases, addr, EhFrame::cie_from_offset)?;
source

pub fn unwind_info_for_address<'ctx, F, S>( &self, frame: &EhFrame<R>, bases: &BaseAddresses, ctx: &'ctx mut UnwindContext<R::Offset, S>, address: u64, get_cie: F, ) -> Result<&'ctx UnwindTableRow<R::Offset, S>>

Returns the frame unwind information for the given address, or NoUnwindInfoForAddress if there are none.

You must provide a function to get the associated CIE. See PartialFrameDescriptionEntry::parse for more information.

Trait Implementations§

source§

impl<'a, R: Clone + Reader> Clone for EhHdrTable<'a, R>

source§

fn clone(&self) -> EhHdrTable<'a, R>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, R: Debug + Reader> Debug for EhHdrTable<'a, R>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, R> Freeze for EhHdrTable<'a, R>

§

impl<'a, R> RefUnwindSafe for EhHdrTable<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for EhHdrTable<'a, R>
where R: Sync,

§

impl<'a, R> Sync for EhHdrTable<'a, R>
where R: Sync,

§

impl<'a, R> Unpin for EhHdrTable<'a, R>

§

impl<'a, R> UnwindSafe for EhHdrTable<'a, R>
where R: RefUnwindSafe,

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.