Struct unwind::Cursor
[−]
[src]
pub struct Cursor<'a>(_, _);
A cursor into a frame of a stack.
The cursor starts at the current (topmost) frame, and can be advanced downwards through the stack. While a cursor cannot be run "backwards", it can be cloned, and one of the copies advanced while the other continues to refer to the previous frame.
Methods
impl<'a> Cursor<'a>
[src]
fn local<F, T>(f: F) -> Result<T> where
F: FnOnce(Cursor) -> Result<T>,
[src]
F: FnOnce(Cursor) -> Result<T>,
Creates a cursor over the stack of the calling thread.
The cursor is provided to a closure rather than being returned because the stack frame being referenced by the frame must remain alive.
fn remote<T>(
address_space: &'a AddressSpaceRef<T>,
state: &'a T
) -> Result<Cursor<'a>>
[src]
address_space: &'a AddressSpaceRef<T>,
state: &'a T
) -> Result<Cursor<'a>>
Creates a cursor over the stack of a "remote" process.
fn step(&mut self) -> Result<bool>
[src]
Steps the cursor into the next older stack frame.
A return value of false
indicates that the cursor is at the last frame of the stack.
fn register(&mut self, num: RegNum) -> Result<u64>
[src]
Returns the value of an integral register at the current frame.
Based on the calling convention, some registers may not be available in a stack frame.
fn procedure_info(&mut self) -> Result<ProcedureInfo>
[src]
Returns information about the procedure at the current frame.
fn procedure_name_raw(&mut self, buf: &mut [u8], offset: &mut u64) -> Result<()>
[src]
Returns the name of the procedure of the current frame.
The name is copied into the provided buffer, and is null-terminated. If the buffer is too
small to hold the full name, Error::NOMEM
is returned and the buffer contains the
portion of the name that fits (including the null terminator).
The offset of the instruction pointer from the beginning of the identified procedure is
copied into the offset
parameter.
The procedure_name
method provides a higher level wrapper over this method.
In certain contexts, particularly when the binary being unwound has been stripped, the unwinder may not have enough information to properly identify the procedure and will simply return the first label before the frame's instruction pointer. The offset will always be relative to this label.
fn procedure_name(&mut self) -> Result<ProcedureName>
[src]
Returns the name of the procedure of the current frame.
In certain contexts, particularly when the binary being unwound has been stripped, the unwinder may not have enough information to properly identify the procedure and will simply return the first label before the frame's instruction pointer. The offset will always be relative to this label.
fn is_signal_frame(&mut self) -> Result<bool>
[src]
Determines if the current frame is a signal frame.
Signal frames are unique in several ways. More register state is available than normal, and the instruction pointer references the currently executing instruction rather than the next instruction.