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
sourceimpl<'a, R: Reader + 'a> EhHdrTable<'a, R>
impl<'a, R: Reader + 'a> EhHdrTable<'a, R>
sourcepub fn lookup(&self, address: u64, bases: &BaseAddresses) -> Result<Pointer>
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.
sourcepub fn pointer_to_offset(
&self,
ptr: Pointer
) -> Result<EhFrameOffset<R::Offset>>
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.
sourcepub fn fde_for_address<F>(
&self,
frame: &EhFrame<R>,
bases: &BaseAddresses,
address: u64,
get_cie: F
) -> Result<FrameDescriptionEntry<R>> where
F: FnMut(&EhFrame<R>, &BaseAddresses, EhFrameOffset<R::Offset>) -> Result<CommonInformationEntry<R>>,
pub fn fde_for_address<F>(
&self,
frame: &EhFrame<R>,
bases: &BaseAddresses,
address: u64,
get_cie: F
) -> Result<FrameDescriptionEntry<R>> where
F: FnMut(&EhFrame<R>, &BaseAddresses, EhFrameOffset<R::Offset>) -> Result<CommonInformationEntry<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)?;
sourcepub fn unwind_info_for_address<'ctx, F, A: UnwindContextStorage<R>>(
&self,
frame: &EhFrame<R>,
bases: &BaseAddresses,
ctx: &'ctx mut UnwindContext<R, A>,
address: u64,
get_cie: F
) -> Result<&'ctx UnwindTableRow<R, A>> where
F: FnMut(&EhFrame<R>, &BaseAddresses, EhFrameOffset<R::Offset>) -> Result<CommonInformationEntry<R>>,
pub fn unwind_info_for_address<'ctx, F, A: UnwindContextStorage<R>>(
&self,
frame: &EhFrame<R>,
bases: &BaseAddresses,
ctx: &'ctx mut UnwindContext<R, A>,
address: u64,
get_cie: F
) -> Result<&'ctx UnwindTableRow<R, A>> where
F: FnMut(&EhFrame<R>, &BaseAddresses, EhFrameOffset<R::Offset>) -> Result<CommonInformationEntry<R>>,
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
sourceimpl<'a, R: Clone + Reader> Clone for EhHdrTable<'a, R>
impl<'a, R: Clone + Reader> Clone for EhHdrTable<'a, R>
sourcefn clone(&self) -> EhHdrTable<'a, R>
fn clone(&self) -> EhHdrTable<'a, R>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more