pub struct EhFrame<R: Reader> { /* private fields */ }
Expand description
EhFrame
contains the frame unwinding information needed during exception
handling found in the .eh_frame
section.
Most interesting methods are defined in the
UnwindSection
trait.
See
DebugFrame
for some discussion on the differences between .debug_frame
and
.eh_frame
.
Implementations
sourceimpl<R: Reader> EhFrame<R>
impl<R: Reader> EhFrame<R>
sourcepub fn set_address_size(&mut self, address_size: u8)
pub fn set_address_size(&mut self, address_size: u8)
Set the size of a target address in bytes.
This defaults to the native word size.
sourceimpl<'input, Endian> EhFrame<EndianSlice<'input, Endian>> where
Endian: Endianity,
impl<'input, Endian> EhFrame<EndianSlice<'input, Endian>> where
Endian: Endianity,
sourcepub fn new(section: &'input [u8], endian: Endian) -> Self
pub fn new(section: &'input [u8], endian: Endian) -> Self
Construct a new EhFrame
instance from the data in the
.debug_frame
section.
It is the caller’s responsibility to read the section and present it as
a &[u8]
slice. That means using some ELF loader on Linux, a Mach-O
loader on OSX, etc.
use gimli::{EhFrame, EndianSlice, NativeEndian};
// Use with `.debug_frame`
let debug_frame = EhFrame::new(read_debug_frame_section_somehow(), NativeEndian);
Trait Implementations
sourceimpl<R: Reader> Section<R> for EhFrame<R>
impl<R: Reader> Section<R> for EhFrame<R>
sourcefn section_name() -> &'static str
fn section_name() -> &'static str
Returns the ELF section name for this type.
sourcefn dwo_section_name() -> Option<&'static str>
fn dwo_section_name() -> Option<&'static str>
Returns the ELF section name (if any) for this type when used in a dwo file. Read more
sourcefn load<F, E>(f: F) -> Result<Self, E> where
F: FnOnce(SectionId) -> Result<R, E>,
fn load<F, E>(f: F) -> Result<Self, E> where
F: FnOnce(SectionId) -> Result<R, E>,
Try to load the section using the given loader function.
sourcefn dwp_range(&self, offset: u32, size: u32) -> Result<Self> where
R: Reader,
fn dwp_range(&self, offset: u32, size: u32) -> Result<Self> where
R: Reader,
Returns the subrange of the section that is the contribution of
a unit in a .dwp
file. Read more
sourcefn lookup_offset_id(&self, id: ReaderOffsetId) -> Option<(SectionId, R::Offset)> where
R: Reader,
fn lookup_offset_id(&self, id: ReaderOffsetId) -> Option<(SectionId, R::Offset)> where
R: Reader,
Returns the Reader
for this section.
sourceimpl<R: Reader> UnwindSection<R> for EhFrame<R>
impl<R: Reader> UnwindSection<R> for EhFrame<R>
type Offset = EhFrameOffset<R::Offset>
type Offset = EhFrameOffset<R::Offset>
The offset type associated with this CFI section. Either
DebugFrameOffset
or EhFrameOffset
. Read more
sourcefn entries<'bases>(
&self,
bases: &'bases BaseAddresses
) -> CfiEntriesIter<'bases, Self, R>
fn entries<'bases>(
&self,
bases: &'bases BaseAddresses
) -> CfiEntriesIter<'bases, Self, R>
Iterate over the CommonInformationEntry
s and FrameDescriptionEntry
s
in this .debug_frame
section. Read more
sourcefn cie_from_offset(
&self,
bases: &BaseAddresses,
offset: Self::Offset
) -> Result<CommonInformationEntry<R>>
fn cie_from_offset(
&self,
bases: &BaseAddresses,
offset: Self::Offset
) -> Result<CommonInformationEntry<R>>
Parse the CommonInformationEntry
at the given offset.
sourcefn partial_fde_from_offset<'bases>(
&self,
bases: &'bases BaseAddresses,
offset: Self::Offset
) -> Result<PartialFrameDescriptionEntry<'bases, Self, R>>
fn partial_fde_from_offset<'bases>(
&self,
bases: &'bases BaseAddresses,
offset: Self::Offset
) -> Result<PartialFrameDescriptionEntry<'bases, Self, R>>
Parse the PartialFrameDescriptionEntry
at the given offset.
sourcefn fde_from_offset<F>(
&self,
bases: &BaseAddresses,
offset: Self::Offset,
get_cie: F
) -> Result<FrameDescriptionEntry<R>> where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
fn fde_from_offset<F>(
&self,
bases: &BaseAddresses,
offset: Self::Offset,
get_cie: F
) -> Result<FrameDescriptionEntry<R>> where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
Parse the FrameDescriptionEntry
at the given offset.
sourcefn fde_for_address<F>(
&self,
bases: &BaseAddresses,
address: u64,
get_cie: F
) -> Result<FrameDescriptionEntry<R>> where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
fn fde_for_address<F>(
&self,
bases: &BaseAddresses,
address: u64,
get_cie: F
) -> Result<FrameDescriptionEntry<R>> where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
Find the FrameDescriptionEntry
for the given address. Read more
sourcefn unwind_info_for_address<'ctx, F, A: UnwindContextStorage<R>>(
&self,
bases: &BaseAddresses,
ctx: &'ctx mut UnwindContext<R, A>,
address: u64,
get_cie: F
) -> Result<&'ctx UnwindTableRow<R, A>> where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
fn unwind_info_for_address<'ctx, F, A: UnwindContextStorage<R>>(
&self,
bases: &BaseAddresses,
ctx: &'ctx mut UnwindContext<R, A>,
address: u64,
get_cie: F
) -> Result<&'ctx UnwindTableRow<R, A>> where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
Find the frame unwind information for the given address. Read more
impl<R: Copy + Reader> Copy for EhFrame<R>
impl<R: Eq + Reader> Eq for EhFrame<R>
impl<R: Reader> StructuralEq for EhFrame<R>
impl<R: Reader> StructuralPartialEq for EhFrame<R>
Auto Trait Implementations
impl<R> RefUnwindSafe for EhFrame<R> where
R: RefUnwindSafe,
impl<R> Send for EhFrame<R> where
R: Send,
impl<R> Sync for EhFrame<R> where
R: Sync,
impl<R> Unpin for EhFrame<R> where
R: Unpin,
impl<R> UnwindSafe for EhFrame<R> where
R: UnwindSafe,
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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