Struct gimli::UninitializedUnwindContext
[−]
[src]
pub struct UninitializedUnwindContext<'input, Endian>(_) where Endian: Endianity;
Common context needed when evaluating the call frame unwinding information.
To avoid re-allocating the context multiple times when evaluating multiple
CFI programs, it can be reused. At first, a context is uninitialized
(UninitializedUnwindContext
). It can be initialized by providing the
CommonInformationEntry
for the CFI program about to be evaluated and
calling UninitializedUnwindContext::initialize
. The result is an
InitializedUnwindContext
, which can be used to evaluate and run a
FrameDescriptionEntry
's CFI program. When the CFI program is complete, the
context can be de-initialized by calling InitializedUnwindContext::reset
.
use gimli::{UninitializedUnwindContext, UnwindTable}; // An uninitialized context. let ctx = UninitializedUnwindContext::new(); // Initialize the context by evaluating the CIE's initial instruction program. let mut ctx = try!(ctx.initialize(some_fde.cie())); { // The initialized context can now be used to generate the unwind table. let mut table = UnwindTable::new(&mut ctx, &some_fde); while let Some(row) = try!(table.next_row()) { // Do stuff with each row... } } // Reset the context to the uninitialized state and re-use it with other CFI // programs. let ctx = ctx.reset();
In general, the states will flow from one to the other in accordance to the following diagram:
+-------+
| Start |
+-------+
|
|
UninitializedUnwindContext::new()
|
|
V
+----------------------------+
| UninitializedUnwindContext |<---------------.
+----------------------------+ |
| |
| |
ctx.initialize(&cie) Use with UnwindTable,
| and then do ctx.reset()
| |
V |
+--------------------------+ |
| InitializedUnwindContext |-----------------'
+--------------------------+
|
|
Drop
|
|
V
+-----+
| End |
+-----+
Methods
impl<'input, Endian> UninitializedUnwindContext<'input, Endian> where Endian: Endianity
[src]
fn new() -> UninitializedUnwindContext<'input, Endian>
Construct a new call frame unwinding context.
fn initialize(self, cie: &CommonInformationEntry<'input, Endian>) -> Result<InitializedUnwindContext<'input, Endian>>
Run the CIE's initial instructions, creating an
InitializedUnwindContext
.
Trait Implementations
impl<'input, Endian: Clone> Clone for UninitializedUnwindContext<'input, Endian> where Endian: Endianity
[src]
fn clone(&self) -> UninitializedUnwindContext<'input, Endian>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more