pub struct UnwindContext<T, S = StoreOnHeap>where
T: ReaderOffset,
S: UnwindContextStorage<T>,{ /* 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, S> UnwindContext<T, S>where
T: ReaderOffset,
S: UnwindContextStorage<T>,
impl<T, S> UnwindContext<T, S>where
T: ReaderOffset,
S: UnwindContextStorage<T>,
§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, S> Clone for UnwindContext<T, S>
impl<T, S> Clone for UnwindContext<T, S>
Source§fn clone(&self) -> UnwindContext<T, S>
fn clone(&self) -> UnwindContext<T, S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more