Struct gimli::read::UnwindContext
source · pub struct UnwindContext<T: ReaderOffset, A: UnwindContextStorage<T> = StoreOnHeap> { /* private fields */ }
Expand description
Common context needed when evaluating the call frame unwinding information.
By default, this structure is small and allocates its internal storage
on the heap using Box
during UnwindContext::new
.
This can be overridden by providing a custom UnwindContextStorage
type parameter.
When using a custom storage with in-line arrays, the UnwindContext
type itself
will be big, so in that case it’s recommended to place UnwindContext
on the
heap, e.g. using Box::new(UnwindContext::<R, MyCustomStorage>::new_in())
.
To avoid re-allocating the context multiple times when evaluating multiple
CFI programs, the same UnwindContext
can be reused for multiple unwinds.
use gimli::{UnwindContext, UnwindTable};
// An uninitialized context.
let mut ctx = UnwindContext::new();
// Initialize the context by evaluating the CIE's initial instruction program,
// and generate the unwind table.
let mut table = some_fde.rows(&eh_frame, &bases, &mut ctx)?;
while let Some(row) = table.next_row()? {
// Do stuff with each row...
}
Implementations§
source§impl<T: ReaderOffset> UnwindContext<T>
impl<T: ReaderOffset> UnwindContext<T>
source§impl<T: ReaderOffset, A: UnwindContextStorage<T>> UnwindContext<T, A>
impl<T: ReaderOffset, A: UnwindContextStorage<T>> UnwindContext<T, A>
§Signal Safe Methods
These methods are guaranteed not to allocate, acquire locks, or perform any other signal-unsafe operations, if an non-allocating storage is used.
Trait Implementations§
source§impl<T: Clone + ReaderOffset, A: Clone + UnwindContextStorage<T>> Clone for UnwindContext<T, A>
impl<T: Clone + ReaderOffset, A: Clone + UnwindContextStorage<T>> Clone for UnwindContext<T, A>
source§fn clone(&self) -> UnwindContext<T, A>
fn clone(&self) -> UnwindContext<T, A>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: ReaderOffset, S: UnwindContextStorage<T>> Debug for UnwindContext<T, S>
impl<T: ReaderOffset, S: UnwindContextStorage<T>> Debug for UnwindContext<T, S>
source§impl<T: ReaderOffset, A: UnwindContextStorage<T>> Default for UnwindContext<T, A>
impl<T: ReaderOffset, A: UnwindContextStorage<T>> Default for UnwindContext<T, A>
source§impl<T: PartialEq + ReaderOffset, A: PartialEq + UnwindContextStorage<T>> PartialEq for UnwindContext<T, A>
impl<T: PartialEq + ReaderOffset, A: PartialEq + UnwindContextStorage<T>> PartialEq for UnwindContext<T, A>
impl<T: Eq + ReaderOffset, A: Eq + UnwindContextStorage<T>> Eq for UnwindContext<T, A>
impl<T: ReaderOffset, A: UnwindContextStorage<T>> StructuralPartialEq for UnwindContext<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for UnwindContext<T, A>
impl<T, A> RefUnwindSafe for UnwindContext<T, A>
impl<T, A> Send for UnwindContext<T, A>
impl<T, A> Sync for UnwindContext<T, A>
impl<T, A> Unpin for UnwindContext<T, A>
impl<T, A> UnwindSafe for UnwindContext<T, A>
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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.