[][src]Struct gimli::read::DebugFrame

pub struct DebugFrame<R: Reader> { /* fields omitted */ }

DebugFrame contains the .debug_frame section's frame unwinding information required to unwind to and recover registers from older frames on the stack. For example, this is useful for a debugger that wants to print locals in a backtrace.

Most interesting methods are defined in the UnwindSection trait.

Differences between .debug_frame and .eh_frame

While the .debug_frame section's information has a lot of overlap with the .eh_frame section's information, the .eh_frame information tends to only encode the subset of information needed for exception handling. Often, only one of .eh_frame or .debug_frame will be present in an object file.

Methods

impl<R: Reader> DebugFrame<R>[src]

pub fn set_address_size(&mut self, address_size: u8)[src]

Set the size of a target address in bytes.

This defaults to the native word size. This is only used if the CIE version is less than 4.

pub fn set_segment_size(&mut self, segment_size: u8)[src]

Set the size of a segment selector in bytes.

This defaults to 0. This is only used if the CIE version is less than 4.

impl<'input, Endian> DebugFrame<EndianSlice<'input, Endian>> where
    Endian: Endianity
[src]

pub fn new(section: &'input [u8], endian: Endian) -> Self[src]

Construct a new DebugFrame 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::{DebugFrame, NativeEndian};

// Use with `.debug_frame`
let debug_frame = DebugFrame::new(read_debug_frame_section_somehow(), NativeEndian);

Trait Implementations

impl<R: Reader> UnwindSection<R> for DebugFrame<R>[src]

type Offset = DebugFrameOffset<R::Offset>

The offset type associated with this CFI section. Either DebugFrameOffset or EhFrameOffset. Read more

fn entries<'bases>(
    &self,
    bases: &'bases BaseAddresses
) -> CfiEntriesIter<'bases, Self, R>
[src]

Iterate over the CommonInformationEntrys and FrameDescriptionEntrys in this .debug_frame section. Read more

fn cie_from_offset(
    &self,
    bases: &BaseAddresses,
    offset: Self::Offset
) -> Result<CommonInformationEntry<R>>
[src]

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]

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]

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]

Find the FrameDescriptionEntry for the given address. Read more

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]

Find the frame unwind information for the given address. Read more

impl<R: Reader> Section<R> for DebugFrame<R>[src]

fn section_name() -> &'static str[src]

Returns the ELF section name for this type.

fn load<F, E>(f: F) -> Result<Self, E> where
    F: FnOnce(SectionId) -> Result<R, E>, 
[src]

Try to load the section using the given loader function.

fn lookup_offset_id(&self, id: ReaderOffsetId) -> Option<(SectionId, R::Offset)> where
    R: Reader
[src]

Returns the Reader for this section.

impl<R: PartialEq + Reader> PartialEq<DebugFrame<R>> for DebugFrame<R>[src]

impl<R: Eq + Reader> Eq for DebugFrame<R>[src]

impl<R: Copy + Reader> Copy for DebugFrame<R>[src]

impl<R: Debug + Reader> Debug for DebugFrame<R>[src]

impl<R: Reader> From<R> for DebugFrame<R>[src]

impl<R: Clone + Reader> Clone for DebugFrame<R>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<R> Send for DebugFrame<R> where
    R: Send

impl<R> Sync for DebugFrame<R> where
    R: Sync

impl<R> Unpin for DebugFrame<R> where
    R: Unpin

impl<R> UnwindSafe for DebugFrame<R> where
    R: UnwindSafe

impl<R> RefUnwindSafe for DebugFrame<R> where
    R: RefUnwindSafe

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]