CACAO
Functions
stacktrace.cpp File Reference

Go to the source code of this file.

Functions

void stacktrace_stackframeinfo_add (stackframeinfo_t *sfi, void *pv, void *sp, void *ra, void *xpc)
 
void stacktrace_stackframeinfo_remove (stackframeinfo_t *sfi)
 
static void stacktrace_stackframeinfo_fill (stackframeinfo_t *tmpsfi, stackframeinfo_t *sfi)
 
static void stacktrace_stackframeinfo_next (stackframeinfo_t *tmpsfi)
 
static bool stacktrace_stackframeinfo_end_check (stackframeinfo_t *tmpsfi)
 
static int stacktrace_depth (stackframeinfo_t *sfi)
 
java_handle_bytearray_tstacktrace_get (stackframeinfo_t *sfi)
 
java_handle_bytearray_tstacktrace_get_current (void)
 
java_handle_tstacktrace_get_StackTraceElement (stacktrace_t *st, int32_t index)
 Creates a java.lang.StackTraceElement for one element of the given stacktrace. More...
 
java_handle_objectarray_tstacktrace_get_StackTraceElements (stacktrace_t *st)
 Creates a complete array of java.lang.StackTraceElement objects for the given stacktrace. More...
 
classinfostacktrace_get_caller_class (int depth)
 
classloader_tstacktrace_first_nonnull_classloader (void)
 Returns the first non-null (user-defined) classloader on the stack. More...
 
static bool is_ancestor_of (classloader_t *loader, classloader_t *parent)
 Checks if a given classloader is equal to the the second classloader or one of its ancestors (parents). More...
 
classloader_tstacktrace_first_nonsystem_classloader (void)
 Returns the first non-system (user-defined) classloader on the stack. More...
 
java_handle_objectarray_tstacktrace_getClassContext (void)
 
classinfostacktrace_get_current_class (void)
 
java_handle_objectarray_tstacktrace_get_stack (void)
 
static void stacktrace_print_entry (methodinfo *m, int32_t linenumber)
 
void stacktrace_print (stacktrace_t *st)
 
void stacktrace_print_current (void)
 
stacktrace_tstacktrace_get_of_thread (threadobject *t)
 Creates a stacktrace for the given thread. More...
 
void stacktrace_print_of_thread (threadobject *t)
 
void stacktrace_print_exception (java_handle_t *h)
 

Function Documentation

static bool is_ancestor_of ( classloader_t loader,
classloader_t parent 
)
static

Checks if a given classloader is equal to the the second classloader or one of its ancestors (parents).

XXX: This helper method should be moved to java_lang_Classloader.

Definition at line 899 of file stacktrace.cpp.

static int stacktrace_depth ( stackframeinfo_t sfi)
static

Definition at line 458 of file stacktrace.cpp.

classloader_t* stacktrace_first_nonnull_classloader ( void  )

Returns the first non-null (user-defined) classloader on the stack.

Returns
The first non-null classloader or NULL if none is found.

Definition at line 851 of file stacktrace.cpp.

classloader_t* stacktrace_first_nonsystem_classloader ( void  )

Returns the first non-system (user-defined) classloader on the stack.

A non-system classloader is a non-null classloader being not equal to the system classloader (or one of its ancestors).

Returns
The first non-system classloader or NULL if none is found.

Definition at line 926 of file stacktrace.cpp.

java_handle_bytearray_t* stacktrace_get ( stackframeinfo_t sfi)

Definition at line 512 of file stacktrace.cpp.

classinfo* stacktrace_get_caller_class ( int  depth)

Definition at line 784 of file stacktrace.cpp.

java_handle_bytearray_t* stacktrace_get_current ( void  )

Definition at line 635 of file stacktrace.cpp.

classinfo* stacktrace_get_current_class ( void  )

Definition at line 1067 of file stacktrace.cpp.

stacktrace_t* stacktrace_get_of_thread ( threadobject t)

Creates a stacktrace for the given thread.

Parameters
tGiven thread.
Returns
Current stacktrace of the given thread.

XXX: Creation of the stacktrace starts at the most recent stackframeinfo block. If the thread is not inside the native world, the created stacktrace is not complete!

Definition at line 1358 of file stacktrace.cpp.

java_handle_objectarray_t* stacktrace_get_stack ( void  )

Definition at line 1135 of file stacktrace.cpp.

java_handle_t* stacktrace_get_StackTraceElement ( stacktrace_t st,
int32_t  index 
)

Creates a java.lang.StackTraceElement for one element of the given stacktrace.

Parameters
stGiven stacktrace.
indexIndex of element inside stacktrace.
Returns
The filled StackTraceElement object.

Definition at line 656 of file stacktrace.cpp.

java_handle_objectarray_t* stacktrace_get_StackTraceElements ( stacktrace_t st)

Creates a complete array of java.lang.StackTraceElement objects for the given stacktrace.

Parameters
stGiven stacktrace.
Returns
Array of filled StackTraceElement objects.

Definition at line 740 of file stacktrace.cpp.

java_handle_objectarray_t* stacktrace_getClassContext ( void  )

Definition at line 978 of file stacktrace.cpp.

void stacktrace_print ( stacktrace_t st)

Definition at line 1286 of file stacktrace.cpp.

void stacktrace_print_current ( void  )

Definition at line 1316 of file stacktrace.cpp.

static void stacktrace_print_entry ( methodinfo m,
int32_t  linenumber 
)
static

Definition at line 1238 of file stacktrace.cpp.

void stacktrace_print_exception ( java_handle_t h)

Definition at line 1432 of file stacktrace.cpp.

void stacktrace_print_of_thread ( threadobject t)

Definition at line 1388 of file stacktrace.cpp.

void stacktrace_stackframeinfo_add ( stackframeinfo_t sfi,
void pv,
void sp,
void ra,
void xpc 
)

Definition at line 84 of file stacktrace.cpp.

static bool stacktrace_stackframeinfo_end_check ( stackframeinfo_t tmpsfi)
inlinestatic

Definition at line 427 of file stacktrace.cpp.

static void stacktrace_stackframeinfo_fill ( stackframeinfo_t tmpsfi,
stackframeinfo_t sfi 
)
inlinestatic

Definition at line 239 of file stacktrace.cpp.

static void stacktrace_stackframeinfo_next ( stackframeinfo_t tmpsfi)
inlinestatic

Definition at line 279 of file stacktrace.cpp.

void stacktrace_stackframeinfo_remove ( stackframeinfo_t sfi)

Definition at line 204 of file stacktrace.cpp.