
@c Extracted automatically from ../jit/jit-walk.c - DO NOT EDIT


@section Stack walking
@cindex Stack walking
@cindex jit-walk.h

The functions in @code{<jit/jit-walk.h>} allow the caller to walk
up the native execution stack, inspecting frames and return addresses.


@deftypefun {void *} jit_get_frame_address (unsigned int @var{n})
Get the frame address for the call frame @var{n} levels up
the stack.  Setting @var{n} to zero will retrieve the frame
address for the current function.  Returns NULL if it isn't
possible to retrieve the address of the specified frame.
@end deftypefun

@deftypefun {void *} jit_get_current_frame (void)
Get the frame address for the current function.  This may be more
efficient on some platforms than using @code{jit_get_frame_address(0)}.
Returns NULL if it isn't possible to retrieve the address of
the current frame.
@end deftypefun

@deftypefun {void *} jit_get_next_frame_address (void *@var{frame})
Get the address of the next frame up the stack from @var{frame}.
Returns NULL if it isn't possible to retrieve the address of
the next frame up the stack.
@end deftypefun

@deftypefun {void *} jit_get_return_address (void *@var{frame})
Get the return address from a specified frame.  The address
represents the place where execution returns to when the
specified frame exits.  Returns NULL if it isn't possible
to retrieve the return address of the specified frame.
@end deftypefun

@deftypefun {void *} jit_get_current_return (void)
Get the return address for the current function.  This may be more
efficient on some platforms than using @code{jit_get_return_address(0)}.
Returns NULL if it isn't possible to retrieve the return address of
the current frame.
@end deftypefun

@deftypefun int jit_frame_contains_crawl_mark (void *@var{frame}, jit_crawl_mark_t *@var{mark})
Determine if the stack frame that resides just above @var{frame}
contains a local variable whose address is @var{mark}.  The @var{mark}
parameter should be the address of a local variable that is declared with
@code{jit_declare_crawl_mark(@var{name})}.

Crawl marks are used internally by libjit to determine where control
passes between JIT'ed and ordinary code during an exception throw.
They can also be used to mark frames that have special security
conditions associated with them.
@end deftypefun

