Struct gimli::read::DebugFrame
source · pub struct DebugFrame<R: Reader> { /* private fields */ }
Expand description
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.
Implementations§
source§impl<R: Reader> DebugFrame<R>
impl<R: Reader> DebugFrame<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. This is only used if the CIE version is less than 4.
sourcepub fn set_vendor(&mut self, vendor: Vendor)
pub fn set_vendor(&mut self, vendor: Vendor)
Set the vendor extensions to use.
This defaults to Vendor::Default
.
source§impl<'input, Endian> DebugFrame<EndianSlice<'input, Endian>>where
Endian: Endianity,
impl<'input, Endian> DebugFrame<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 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 macOS, etc.
use gimli::{DebugFrame, NativeEndian};
// Use with `.debug_frame`
let debug_frame = DebugFrame::new(read_debug_frame_section_somehow(), NativeEndian);
Trait Implementations§
source§impl<R: Clone + Reader> Clone for DebugFrame<R>
impl<R: Clone + Reader> Clone for DebugFrame<R>
source§fn clone(&self) -> DebugFrame<R>
fn clone(&self) -> DebugFrame<R>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<R: Reader> From<R> for DebugFrame<R>
impl<R: Reader> From<R> for DebugFrame<R>
source§impl<R: PartialEq + Reader> PartialEq for DebugFrame<R>
impl<R: PartialEq + Reader> PartialEq for DebugFrame<R>
source§fn eq(&self, other: &DebugFrame<R>) -> bool
fn eq(&self, other: &DebugFrame<R>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<R: Reader> Section<R> for DebugFrame<R>
impl<R: Reader> Section<R> for DebugFrame<R>
source§fn section_name() -> &'static str
fn section_name() -> &'static str
source§fn dwo_section_name() -> Option<&'static str>
fn dwo_section_name() -> Option<&'static str>
source§fn xcoff_section_name() -> Option<&'static str>
fn xcoff_section_name() -> Option<&'static str>
source§fn load<F, E>(f: F) -> Result<Self, E>
fn load<F, E>(f: F) -> Result<Self, E>
source§fn 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,
.dwp
file.source§fn 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,
Reader
for this section.source§impl<R: Reader> UnwindSection<R> for DebugFrame<R>
impl<R: Reader> UnwindSection<R> for DebugFrame<R>
§type Offset = DebugFrameOffset<<R as Reader>::Offset>
type Offset = DebugFrameOffset<<R as Reader>::Offset>
DebugFrameOffset
or EhFrameOffset
.source§fn entries<'bases>(
&self,
bases: &'bases BaseAddresses,
) -> CfiEntriesIter<'bases, Self, R>
fn entries<'bases>( &self, bases: &'bases BaseAddresses, ) -> CfiEntriesIter<'bases, Self, R>
CommonInformationEntry
s and FrameDescriptionEntry
s
in this .debug_frame
section. Read moresource§fn 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>>
CommonInformationEntry
at the given offset.source§fn 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>>
PartialFrameDescriptionEntry
at the given offset.source§fn fde_from_offset<F>(
&self,
bases: &BaseAddresses,
offset: Self::Offset,
get_cie: F,
) -> Result<FrameDescriptionEntry<R>>
fn fde_from_offset<F>( &self, bases: &BaseAddresses, offset: Self::Offset, get_cie: F, ) -> Result<FrameDescriptionEntry<R>>
FrameDescriptionEntry
at the given offset.source§fn fde_for_address<F>(
&self,
bases: &BaseAddresses,
address: u64,
get_cie: F,
) -> Result<FrameDescriptionEntry<R>>
fn fde_for_address<F>( &self, bases: &BaseAddresses, address: u64, get_cie: F, ) -> Result<FrameDescriptionEntry<R>>
FrameDescriptionEntry
for the given address. Read moresource§fn unwind_info_for_address<'ctx, F, S>(
&self,
bases: &BaseAddresses,
ctx: &'ctx mut UnwindContext<R::Offset, S>,
address: u64,
get_cie: F,
) -> Result<&'ctx UnwindTableRow<R::Offset, S>>where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
S: UnwindContextStorage<R::Offset>,
fn unwind_info_for_address<'ctx, F, S>(
&self,
bases: &BaseAddresses,
ctx: &'ctx mut UnwindContext<R::Offset, S>,
address: u64,
get_cie: F,
) -> Result<&'ctx UnwindTableRow<R::Offset, S>>where
F: FnMut(&Self, &BaseAddresses, Self::Offset) -> Result<CommonInformationEntry<R>>,
S: UnwindContextStorage<R::Offset>,
impl<R: Copy + Reader> Copy for DebugFrame<R>
impl<R: Eq + Reader> Eq for DebugFrame<R>
impl<R: Reader> StructuralPartialEq for DebugFrame<R>
Auto Trait Implementations§
impl<R> Freeze for DebugFrame<R>where
R: Freeze,
impl<R> RefUnwindSafe for DebugFrame<R>where
R: RefUnwindSafe,
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,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)