This module contains the interfaces to provide stack walking functionality. Note, that this interfaces are common to all types of stack frames. See specific modules for more on information on particular types of stack frames, e.g. native_frame.h
Classes | |
struct | StackIterator |
Stack iterator structure. More... | |
Typedefs | |
typedef unsigned * | NativeCodePtr |
Pointer to code. | |
typedef ExecutionEngine * | Execution_Engine_Handle |
Opaque pointer to execution engine. | |
typedef Execution_Context | Execution_Context |
Machine-dependent thread context (fully or partly filled): register values. | |
Enumerations | |
enum | ContextType { EC_CT_IP, EC_CT_RETIP } |
Kinds of values stored in executed context. More... | |
enum | SF_Kind { SF_JAVA_REAL = 0x1, SF_JAVA_INLINED = 0x2, SF_JNI = 0x4, SF_VM = 0x8, SF_JAVA = SF_JAVA_REAL | SF_JAVA_INLINED, SF_OTHER } |
Kinds of stack frame. More... | |
Functions | |
Execution_Context | ec_get_current () |
Return execution context of current thread. | |
Execution_Context | ec_get_suspended (Thread_Handle thread) |
Return execution context of suspended thread. | |
void | ec_update_current () |
On architectures with register stacks, ensure that the register stack of the current thread is consistent with its backing store, as the backing store might have been modified by stack walking code. | |
ContextValue | ec_get (Execution_Context context, ContextType type) |
Returns value contained in specified executing context for specified register. | |
void | ec_set (Execution_Context context, ContextType type, ContextValue value) |
Sets value contained in specified executing context for specified register. | |
StackIterator * | si_create (Execution_Context *context) |
Create stack iterator for the specified execution context. | |
StackIterator * | si_dup (StackIterator *iterator) |
Duplicate stack iterator. | |
void | si_free (StackIterator *iterator) |
Free memory used by stack iterator. | |
SF_Kind | si_get_kind (StackIterator *iterator) |
Returns the kind of the current stack frame. | |
bool | si_next (StackIterator *iterator, SF_Kind kind) |
Iterate to next stack frame. | |
bool | si_done (StackIterator *iterator) |
Returns true if iteration is over. | |
bool | si_is_unwindable (StackIterator *iterator) |
Returns true if current stack frame is unwindable. | |
void | si_unwind (StackIterator *iterator) |
Unwind current stack frame with restoring the values of saved registers. | |
void | si_transfer_control (StackIterator *iterator) |
Resume current stack frame on current thread. | |
Execution_Context * | si_get_context (StackIterator *iterator) |
Return pointer to context structure of the current stack frame context. | |
Execution_Engine_Handle | si_get_owner (StackIterator *iterator) |
Get the pointer to the owner of the stack frame (i.e. | |
void | si_enumerate (StackIterator *iterator) |
Enumerate live pointers in current stack frame. | |
void * | si_get_info (StackIterator *iterator) |
Retrieves information associated with current stack frame. | |
Method_Handle | si_get_method (StackIterator *iterator) |
Get the method handle of the current stack frame. | |
void | si_get_trace_file (StackIterator *iterator, char *buf, int length) |
Retrieves the file name corresponding to the current stack frame. | |
int | si_get_trace_line (StackIterator *iterator) |
Retrieves the line number corresponding to the current stack frame. | |
void | si_get_debug_info (StackIterator *iterator, char *buf, int length) |
Retrieves debug information associated with the current stack frame. |
typedef unsigned* NativeCodePtr |
Pointer to code.
typedef struct ExecutionEngine* Execution_Engine_Handle |
Opaque pointer to execution engine.
typedef struct Execution_Context Execution_Context |
Machine-dependent thread context (fully or partly filled): register values.
enum ContextType |
enum SF_Kind |
Kinds of stack frame.
This classification is intended for security manager to be able to distinguish stack frames it does not need to take into account, for example, VM stack frames.
Execution_Context ec_get_current | ( | ) |
Return execution context of current thread.
Execution_Context ec_get_suspended | ( | Thread_Handle | thread | ) |
Return execution context of suspended thread.
void ec_update_current | ( | ) |
On architectures with register stacks, ensure that the register stack of the current thread is consistent with its backing store, as the backing store might have been modified by stack walking code.
ContextValue ec_get | ( | Execution_Context | context, | |
ContextType | type | |||
) |
Returns value contained in specified executing context for specified register.
void ec_set | ( | Execution_Context | context, | |
ContextType | type, | |||
ContextValue | value | |||
) |
Sets value contained in specified executing context for specified register.
StackIterator* si_create | ( | Execution_Context * | context | ) |
Create stack iterator for the specified execution context.
StackIterator* si_dup | ( | StackIterator * | iterator | ) |
Duplicate stack iterator.
void si_free | ( | StackIterator * | iterator | ) |
Free memory used by stack iterator.
SF_Kind si_get_kind | ( | StackIterator * | iterator | ) |
Returns the kind of the current stack frame.
bool si_next | ( | StackIterator * | iterator, | |
SF_Kind | kind | |||
) |
Iterate to next stack frame.
iterator | - the pointer to the stack frame |
bool si_done | ( | StackIterator * | iterator | ) |
Returns true if iteration is over.
iterator | - the pointer to the stack frame |
bool si_is_unwindable | ( | StackIterator * | iterator | ) |
Returns true if current stack frame is unwindable.
iterator | - the pointer to the stack frame |
void si_unwind | ( | StackIterator * | iterator | ) |
Unwind current stack frame with restoring the values of saved registers.
The synchronization objects must be carefully released by this method.
iterator | - the pointer to the stack frame |
void si_transfer_control | ( | StackIterator * | iterator | ) |
Resume current stack frame on current thread.
This function frees the iterator and does not return.
iterator | - the pointer to the stack frame |
Execution_Context* si_get_context | ( | StackIterator * | iterator | ) |
Return pointer to context structure of the current stack frame context.
iterator | - the pointer to the stack frame |
Execution_Engine_Handle si_get_owner | ( | StackIterator * | iterator | ) |
Get the pointer to the owner of the stack frame (i.e.
JIT or interpreter).
iterator | - the pointer to the stack frame |
void si_enumerate | ( | StackIterator * | iterator | ) |
Enumerate live pointers in current stack frame.
iterator | - the pointer to the stack frame |
void* si_get_info | ( | StackIterator * | iterator | ) |
Retrieves information associated with current stack frame.
For native or interpreter frames it is likely to return pointer to the actual frame structure, for jitted frames may return the value of base stack register.
The returned value may be used as a parameter to functions provided by the execution engine owning the stack frame.
iterator | - the pointer to the stack frame |
Method_Handle si_get_method | ( | StackIterator * | iterator | ) |
Get the method handle of the current stack frame.
iterator | - the pointer to the stack frame |
void si_get_trace_file | ( | StackIterator * | iterator, | |
char * | buf, | |||
int | length | |||
) |
Retrieves the file name corresponding to the current stack frame.
If no information is available, an empty string is written to the buffer.
iterator | - the pointer to the stack frame | |
buf | - the buffer to be filled | |
length | - the size of the buffer. If the size is not sufficient to hold the file name, then file name is truncated. |
int si_get_trace_line | ( | StackIterator * | iterator | ) |
Retrieves the line number corresponding to the current stack frame.
If the number is not available, returns 0.
iterator | - the pointer to the stack frame |
void si_get_debug_info | ( | StackIterator * | iterator, | |
char * | buf, | |||
int | length | |||
) |
Retrieves debug information associated with the current stack frame.
The format of this information is implementation-dependent.
iterator | - the pointer to the stack frame |
Genereated on Tue Mar 11 19:25:58 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.