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>
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§
Source§impl<'a, R: Clone + Reader> Clone for EhHdrTable<'a, R>
impl<'a, R: Clone + Reader> Clone for EhHdrTable<'a, R>
Source§fn clone(&self) -> EhHdrTable<'a, R>
fn clone(&self) -> EhHdrTable<'a, R>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more