Trait gimli::read::UnwindSection [−][src]
A section holding unwind information: either .debug_frame or
.eh_frame. See DebugFrame and
EhFrame respectively.
Associated Types
type Offset: UnwindOffset<R::Offset>[src]
The offset type associated with this CFI section. Either
DebugFrameOffset or EhFrameOffset.
Provided methods
fn entries<'bases>(
&self,
bases: &'bases BaseAddresses
) -> CfiEntriesIter<'bases, Self, R>[src]
&self,
bases: &'bases BaseAddresses
) -> CfiEntriesIter<'bases, Self, R>
Iterate over the CommonInformationEntrys and FrameDescriptionEntrys
in this .debug_frame section.
Can be used with
FallibleIterator.
fn cie_from_offset(
&self,
bases: &BaseAddresses,
offset: Self::Offset
) -> Result<CommonInformationEntry<R>>[src]
&self,
bases: &BaseAddresses,
offset: Self::Offset
) -> Result<CommonInformationEntry<R>>
Parse the CommonInformationEntry at the given offset.
fn partial_fde_from_offset<'bases>(
&self,
bases: &'bases BaseAddresses,
offset: Self::Offset
) -> Result<PartialFrameDescriptionEntry<'bases, Self, R>>[src]
&self,
bases: &'bases BaseAddresses,
offset: Self::Offset
) -> Result<PartialFrameDescriptionEntry<'bases, Self, R>>
Parse the PartialFrameDescriptionEntry at the given offset.
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>>, [src]
&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.
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>>, [src]
&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.
If found, the FDE is returned. If not found,
Err(gimli::Error::NoUnwindInfoForAddress) is returned.
If parsing fails, the error is returned.
You must provide a function to get its associated CIE. See
PartialFrameDescriptionEntry::parse for more information.
Note: this iterates over all FDEs. If available, it is possible
to do a binary search with EhFrameHdr::fde_for_address instead.
fn unwind_info_for_address<F>(
&self,
bases: &BaseAddresses,
ctx: &mut UninitializedUnwindContext<R>,
address: u64,
get_cie: F
) -> Result<UnwindTableRow<R>> where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>, [src]
&self,
bases: &BaseAddresses,
ctx: &mut UninitializedUnwindContext<R>,
address: u64,
get_cie: F
) -> Result<UnwindTableRow<R>> where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
Find the frame unwind information for the given address.
If found, the unwind information is returned. If not found,
Err(gimli::Error::NoUnwindInfoForAddress) is returned. If parsing or
CFI evaluation fails, the error is returned.
use gimli::{BaseAddresses, EhFrame, EndianSlice, NativeEndian, UninitializedUnwindContext, UnwindSection}; // Get the `.eh_frame` section from the object file. Alternatively, // use `EhFrame` with the `.eh_frame` section of the object file. let eh_frame = EhFrame::new(read_eh_frame_section(), NativeEndian); // Get the address of the PC for a frame you'd like to unwind. let address = get_frame_pc(); // This context is reusable, which cuts down on heap allocations. let ctx = UninitializedUnwindContext::new(); // Optionally provide base addresses for any relative pointers. If a // base address isn't provided and a pointer is found that is relative to // it, we will return an `Err`. let bases = BaseAddresses::default() .set_text(address_of_text_section_in_memory) .set_got(address_of_got_section_in_memory); let unwind_info = eh_frame.unwind_info_for_address( &bases, &mut ctx, address, EhFrame::cie_from_offset, )?; do_stuff_with(unwind_info);