Struct gimli::read::FrameDescriptionEntry
source · pub struct FrameDescriptionEntry<R, Offset = <R as Reader>::Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,{
offset: Offset,
length: Offset,
format: Format,
cie: CommonInformationEntry<R, Offset>,
initial_address: u64,
address_range: u64,
augmentation: Option<AugmentationData>,
instructions: R,
}
Expand description
A FrameDescriptionEntry
is a set of CFA instructions for an address range.
Fields§
§offset: Offset
The start of this entry within its containing section.
length: Offset
A constant that gives the number of bytes of the header and instruction stream for this function, not including the length field itself (see Section 7.2.2). The size of the length field plus the value of length must be an integral multiple of the address size.
format: Format
§cie: CommonInformationEntry<R, Offset>
“A constant offset into the .debug_frame section that denotes the CIE that is associated with this FDE.”
This is the CIE at that offset.
initial_address: u64
The address of the first location associated with this table entry. If the segment_size field of this FDE’s CIE is non-zero, the initial location is preceded by a segment selector of the given length.
address_range: u64
“The number of bytes of program instructions described by this entry.”
augmentation: Option<AugmentationData>
The parsed augmentation data, if we have any.
instructions: R
“A sequence of table defining instructions that are described below.”
This is followed by DW_CFA_nop
padding until length
bytes of the
input are consumed.
Implementations§
source§impl<R: Reader> FrameDescriptionEntry<R>
impl<R: Reader> FrameDescriptionEntry<R>
fn parse_rest<Section, F>(
offset: R::Offset,
length: R::Offset,
format: Format,
cie_pointer: Section::Offset,
rest: R,
section: &Section,
bases: &BaseAddresses,
get_cie: F,
) -> Result<FrameDescriptionEntry<R>>where
Section: UnwindSection<R>,
F: FnMut(&Section, &BaseAddresses, Section::Offset) -> Result<CommonInformationEntry<R>>,
fn parse_addresses( input: &mut R, cie: &CommonInformationEntry<R>, parameters: &PointerEncodingParameters<'_, R>, ) -> Result<(u64, u64)>
sourcepub fn rows<'a, 'ctx, Section, S>(
&self,
section: &'a Section,
bases: &'a BaseAddresses,
ctx: &'ctx mut UnwindContext<R::Offset, S>,
) -> Result<UnwindTable<'a, 'ctx, R, S>>
pub fn rows<'a, 'ctx, Section, S>( &self, section: &'a Section, bases: &'a BaseAddresses, ctx: &'ctx mut UnwindContext<R::Offset, S>, ) -> Result<UnwindTable<'a, 'ctx, R, S>>
Return the table of unwind information for this FDE.
sourcepub fn unwind_info_for_address<'ctx, Section, S>(
&self,
section: &Section,
bases: &BaseAddresses,
ctx: &'ctx mut UnwindContext<R::Offset, S>,
address: u64,
) -> Result<&'ctx UnwindTableRow<R::Offset, S>>
pub fn unwind_info_for_address<'ctx, Section, S>( &self, section: &Section, bases: &BaseAddresses, ctx: &'ctx mut UnwindContext<R::Offset, S>, address: u64, ) -> Result<&'ctx UnwindTableRow<R::Offset, S>>
Find the frame unwind information for the given address.
If found, the unwind information is returned along with the reset
context in the form Ok((unwind_info, context))
. If not found,
Err(gimli::Error::NoUnwindInfoForAddress)
is returned. If parsing or
CFI evaluation fails, the error is returned.
source§impl<R: Reader> FrameDescriptionEntry<R>
impl<R: Reader> FrameDescriptionEntry<R>
§Signal Safe Methods
These methods are guaranteed not to allocate, acquire locks, or perform any other signal-unsafe operations.
sourcepub fn offset(&self) -> R::Offset
pub fn offset(&self) -> R::Offset
Get the offset of this entry from the start of its containing section.
sourcepub fn cie(&self) -> &CommonInformationEntry<R>
pub fn cie(&self) -> &CommonInformationEntry<R>
Get a reference to this FDE’s CIE.
sourcepub fn entry_len(&self) -> R::Offset
pub fn entry_len(&self) -> R::Offset
A constant that gives the number of bytes of the header and instruction stream for this function, not including the length field itself (see Section 7.2.2). The size of the length field plus the value of length must be an integral multiple of the address size.
sourcepub fn instructions<'a, Section>(
&self,
section: &'a Section,
bases: &'a BaseAddresses,
) -> CallFrameInstructionIter<'a, R>where
Section: UnwindSection<R>,
pub fn instructions<'a, Section>(
&self,
section: &'a Section,
bases: &'a BaseAddresses,
) -> CallFrameInstructionIter<'a, R>where
Section: UnwindSection<R>,
Iterate over this FDE’s instructions.
Will not include the CIE’s initial instructions, if you want those do
fde.cie().instructions()
first.
Can be used with
FallibleIterator
.
sourcepub fn initial_address(&self) -> u64
pub fn initial_address(&self) -> u64
The first address for which this entry has unwind information for.
sourcepub fn end_address(&self) -> u64
pub fn end_address(&self) -> u64
One more than the last address that this entry has unwind information for.
This uses wrapping arithmetic, so the result may be less than
initial_address
.
sourcepub fn len(&self) -> u64
pub fn len(&self) -> u64
The number of bytes of instructions that this entry has unwind information for.
sourcepub fn contains(&self, address: u64) -> bool
pub fn contains(&self, address: u64) -> bool
Return true
if the given address is within this FDE, false
otherwise.
This is equivalent to entry.initial_address() <= address < entry.initial_address() + entry.len()
.
sourcepub fn lsda(&self) -> Option<Pointer>
pub fn lsda(&self) -> Option<Pointer>
The address of this FDE’s language-specific data area (LSDA), if it has any.
sourcepub fn is_signal_trampoline(&self) -> bool
pub fn is_signal_trampoline(&self) -> bool
Return true if this FDE’s function is a trampoline for a signal handler.
sourcepub fn personality(&self) -> Option<Pointer>
pub fn personality(&self) -> Option<Pointer>
Return the address of the FDE’s function’s personality routine handler. The personality routine does language-specific clean up when unwinding the stack frames with the intent to not run them again.
Trait Implementations§
source§impl<R, Offset> Clone for FrameDescriptionEntry<R, Offset>
impl<R, Offset> Clone for FrameDescriptionEntry<R, Offset>
source§fn clone(&self) -> FrameDescriptionEntry<R, Offset>
fn clone(&self) -> FrameDescriptionEntry<R, Offset>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<R, Offset> Debug for FrameDescriptionEntry<R, Offset>
impl<R, Offset> Debug for FrameDescriptionEntry<R, Offset>
source§impl<R, Offset> PartialEq for FrameDescriptionEntry<R, Offset>
impl<R, Offset> PartialEq for FrameDescriptionEntry<R, Offset>
source§fn eq(&self, other: &FrameDescriptionEntry<R, Offset>) -> bool
fn eq(&self, other: &FrameDescriptionEntry<R, Offset>) -> bool
self
and other
values to be equal, and is used
by ==
.