Struct gimli::read::UnwindTableRow
source · [−]pub struct UnwindTableRow<R: Reader, S: UnwindContextStorage<R> = StoreOnHeap> { /* private fields */ }
Expand description
A row in the virtual unwind table that describes how to find the values of the registers in the previous frame for a range of PC addresses.
Implementations
sourceimpl<R: Reader, S: UnwindContextStorage<R>> UnwindTableRow<R, S>
impl<R: Reader, S: UnwindContextStorage<R>> UnwindTableRow<R, S>
sourcepub fn start_address(&self) -> u64
pub fn start_address(&self) -> u64
Get the starting PC address that this row applies to.
sourcepub fn end_address(&self) -> u64
pub fn end_address(&self) -> u64
Get the end PC address where this row’s register rules become unapplicable.
In other words, this row describes how to recover the last frame’s
registers for all PCs where row.start_address() <= PC < row.end_address()
. This row does NOT describe how to recover registers
when PC == row.end_address()
.
sourcepub fn contains(&self, address: u64) -> bool
pub fn contains(&self, address: u64) -> bool
Return true
if the given address
is within this row’s address range,
false
otherwise.
sourcepub fn saved_args_size(&self) -> u64
pub fn saved_args_size(&self) -> u64
Returns the amount of args currently on the stack.
When unwinding, if the personality function requested a change in IP, the SP needs to be adjusted by saved_args_size.
sourcepub fn cfa(&self) -> &CfaRule<R>
pub fn cfa(&self) -> &CfaRule<R>
Get the canonical frame address (CFA) recovery rule for this row.
sourcepub fn register(&self, register: Register) -> RegisterRule<R>
pub fn register(&self, register: Register) -> RegisterRule<R>
Get the register recovery rule for the given register number.
The register number mapping is architecture dependent. For example, in the x86-64 ABI the register number mapping is defined in Figure 3.36:
Figure 3.36: DWARF Register Number Mapping
Register Name Number Abbreviation General Purpose Register RAX 0 %rax General Purpose Register RDX 1 %rdx General Purpose Register RCX 2 %rcx General Purpose Register RBX 3 %rbx General Purpose Register RSI 4 %rsi General Purpose Register RDI 5 %rdi General Purpose Register RBP 6 %rbp Stack Pointer Register RSP 7 %rsp Extended Integer Registers 8-15 8-15 %r8-%r15 Return Address RA 16 Vector Registers 0–7 17-24 %xmm0–%xmm7 Extended Vector Registers 8–15 25-32 %xmm8–%xmm15 Floating Point Registers 0–7 33-40 %st0–%st7 MMX Registers 0–7 41-48 %mm0–%mm7 Flag Register 49 %rFLAGS Segment Register ES 50 %es Segment Register CS 51 %cs Segment Register SS 52 %ss Segment Register DS 53 %ds Segment Register FS 54 %fs Segment Register GS 55 %gs Reserved 56-57 FS Base address 58 %fs.base GS Base address 59 %gs.base Reserved 60-61 Task Register 62 %tr LDT Register 63 %ldtr 128-bit Media Control and Status 64 %mxcsr x87 Control Word 65 %fcw x87 Status Word 66 %fsw Upper Vector Registers 16–31 67-82 %xmm16–%xmm31 Reserved 83-117 Vector Mask Registers 0–7 118-125 %k0–%k7 Reserved 126-129
sourcepub fn registers(&self) -> RegisterRuleIter<'_, R>ⓘNotable traits for RegisterRuleIter<'iter, R>impl<'iter, R: Reader> Iterator for RegisterRuleIter<'iter, R> type Item = &'iter (Register, RegisterRule<R>);
pub fn registers(&self) -> RegisterRuleIter<'_, R>ⓘNotable traits for RegisterRuleIter<'iter, R>impl<'iter, R: Reader> Iterator for RegisterRuleIter<'iter, R> type Item = &'iter (Register, RegisterRule<R>);
Iterate over all defined register (number, rule)
pairs.
The rules are not iterated in any guaranteed order. Any register that
does not make an appearance in the iterator implicitly has the rule
RegisterRule::Undefined
.
for &(register, ref rule) in unwind_table_row.registers() {
// ...
}
Trait Implementations
sourceimpl<R: Reader, S: UnwindContextStorage<R>> Clone for UnwindTableRow<R, S>
impl<R: Reader, S: UnwindContextStorage<R>> Clone for UnwindTableRow<R, S>
sourceimpl<R: Reader, S: UnwindContextStorage<R>> Debug for UnwindTableRow<R, S>
impl<R: Reader, S: UnwindContextStorage<R>> Debug for UnwindTableRow<R, S>
sourceimpl<R: Reader, S: UnwindContextStorage<R>> Default for UnwindTableRow<R, S>
impl<R: Reader, S: UnwindContextStorage<R>> Default for UnwindTableRow<R, S>
sourceimpl<R: PartialEq + Reader, S: PartialEq + UnwindContextStorage<R>> PartialEq<UnwindTableRow<R, S>> for UnwindTableRow<R, S>
impl<R: PartialEq + Reader, S: PartialEq + UnwindContextStorage<R>> PartialEq<UnwindTableRow<R, S>> for UnwindTableRow<R, S>
sourcefn eq(&self, other: &UnwindTableRow<R, S>) -> bool
fn eq(&self, other: &UnwindTableRow<R, S>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UnwindTableRow<R, S>) -> bool
fn ne(&self, other: &UnwindTableRow<R, S>) -> bool
This method tests for !=
.
impl<R: Eq + Reader, S: Eq + UnwindContextStorage<R>> Eq for UnwindTableRow<R, S>
impl<R: Reader, S: UnwindContextStorage<R>> StructuralEq for UnwindTableRow<R, S>
impl<R: Reader, S: UnwindContextStorage<R>> StructuralPartialEq for UnwindTableRow<R, S>
Auto Trait Implementations
impl<R, S> RefUnwindSafe for UnwindTableRow<R, S> where
R: RefUnwindSafe,
<<S as UnwindContextStorage<R>>::Rules as Sealed>::Storage: RefUnwindSafe,
impl<R, S> Send for UnwindTableRow<R, S> where
R: Send,
<<S as UnwindContextStorage<R>>::Rules as Sealed>::Storage: Send,
impl<R, S> Sync for UnwindTableRow<R, S> where
R: Sync,
<<S as UnwindContextStorage<R>>::Rules as Sealed>::Storage: Sync,
impl<R, S> Unpin for UnwindTableRow<R, S> where
R: Unpin,
<<S as UnwindContextStorage<R>>::Rules as Sealed>::Storage: Unpin,
impl<R, S> UnwindSafe for UnwindTableRow<R, S> where
R: UnwindSafe,
<<S as UnwindContextStorage<R>>::Rules as Sealed>::Storage: 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