Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: stacktrace.c 7631 2007-04-02 20:04:22Z michi $
+ $Id: stacktrace.c 7651 2007-04-03 14:00:32Z twisti $
*/
#endif /* defined(ENABLE_INTRP) */
-/* stacktrace_create_inline_stackframeinfo *************************************
-
- Creates an stackframe info structure for an inline exception stub.
-
-*******************************************************************************/
-
-void stacktrace_create_inline_stackframeinfo(stackframeinfo *sfi, u1 *pv,
- u1 *sp, u1 *ra, u1 *xpc)
-{
- stackframeinfo **psfi;
-
- /* get current stackframe info pointer */
-
- psfi = STACKFRAMEINFO;
-
-#if defined(ENABLE_INTRP)
- if (opt_intrp) {
- /* if we don't have pv handy */
-
- if (pv == NULL)
- pv = codegen_get_pv_from_pc(ra);
-
- }
-#endif
-
- /* fill new stackframe info structure */
-
- sfi->prev = *psfi;
- sfi->method = NULL;
- sfi->pv = pv;
- sfi->sp = sp;
- sfi->ra = ra;
- sfi->xpc = xpc;
-
- /* store new stackframe info pointer */
-
- *psfi = sfi;
-}
-
-
/* stacktrace_create_extern_stackframeinfo *************************************
Creates an stackframe info structure for an extern exception
}
-/* stacktrace_inline_arithmeticexception ***************************************
-
- Creates an ArithemticException for inline stub.
-
-*******************************************************************************/
-
-java_objectheader *stacktrace_inline_arithmeticexception(u1 *pv, u1 *sp,
- u1 *ra, u1 *xpc)
-{
- stackframeinfo sfi;
- java_objectheader *o;
-
- /* create stackframeinfo */
-
- stacktrace_create_inline_stackframeinfo(&sfi, pv, sp, ra, xpc);
-
- /* create exception */
-
- o = exceptions_new_arithmeticexception();
-
- /* remove stackframeinfo */
-
- stacktrace_remove_stackframeinfo(&sfi);
-
- return o;
-}
-
-
-/* stacktrace_inline_arrayindexoutofboundsexception ****************************
-
- Creates an ArrayIndexOutOfBoundsException for inline stub.
-
-*******************************************************************************/
-
-java_objectheader *stacktrace_inline_arrayindexoutofboundsexception(u1 *pv,
- u1 *sp,
- u1 *ra,
- u1 *xpc,
- s4 index)
-{
- stackframeinfo sfi;
- java_objectheader *o;
-
- /* create stackframeinfo */
-
- stacktrace_create_inline_stackframeinfo(&sfi, pv, sp, ra, xpc);
-
- /* create exception */
-
- o = exceptions_new_arrayindexoutofboundsexception(index);
-
- /* remove stackframeinfo */
-
- stacktrace_remove_stackframeinfo(&sfi);
-
- return o;
-}
-
-
-/* stacktrace_inline_arraystoreexception ***************************************
-
- Creates an ArrayStoreException for inline stub.
-
-*******************************************************************************/
-
-java_objectheader *stacktrace_inline_arraystoreexception(u1 *pv, u1 *sp, u1 *ra,
- u1 *xpc)
-{
- stackframeinfo sfi;
- java_objectheader *o;
-
- /* create stackframeinfo */
-
- stacktrace_create_inline_stackframeinfo(&sfi, pv, sp, ra, xpc);
-
- /* create exception */
-
- o = exceptions_new_arraystoreexception();
-
- /* remove stackframeinfo */
-
- stacktrace_remove_stackframeinfo(&sfi);
-
- return o;
-}
-
-
-/* stacktrace_inline_classcastexception ****************************************
-
- Creates an ClassCastException for inline stub.
-
-*******************************************************************************/
-
-java_objectheader *stacktrace_inline_classcastexception(u1 *pv, u1 *sp, u1 *ra,
- u1 *xpc,
- java_objectheader *o)
-{
- stackframeinfo sfi;
- java_objectheader *e;
-
- /* create stackframeinfo */
-
- stacktrace_create_inline_stackframeinfo(&sfi, pv, sp, ra, xpc);
-
- /* create exception */
-
- e = exceptions_new_classcastexception(o);
-
- /* remove stackframeinfo */
-
- stacktrace_remove_stackframeinfo(&sfi);
-
- return e;
-}
-
-
-/* stacktrace_inline_nullpointerexception **************************************
-
- Creates an NullPointerException for inline stub.
-
-*******************************************************************************/
-
-java_objectheader *stacktrace_inline_nullpointerexception(u1 *pv, u1 *sp,
- u1 *ra, u1 *xpc)
-{
- stackframeinfo sfi;
- java_objectheader *o;
-
- /* create stackframeinfo */
-
- stacktrace_create_inline_stackframeinfo(&sfi, pv, sp, ra, xpc);
-
- /* create exception */
-
- o = exceptions_new_nullpointerexception();
-
- /* remove stackframeinfo */
-
- stacktrace_remove_stackframeinfo(&sfi);
-
- return o;
-}
-
-
-/* stacktrace_inline_fillInStackTrace ******************************************
-
- Fills in the correct stacktrace into an existing exception object
- (this one is for inline exception stubs).
-
-*******************************************************************************/
-
-java_objectheader *stacktrace_inline_fillInStackTrace(u1 *pv, u1 *sp, u1 *ra,
- u1 *xpc)
-{
- stackframeinfo sfi;
- java_objectheader *o;
- methodinfo *m;
-
- /* create stackframeinfo */
-
- stacktrace_create_inline_stackframeinfo(&sfi, pv, sp, ra, xpc);
-
- /* get exception */
-
- o = *exceptionptr;
- assert(o);
-
- /* clear exception */
-
- *exceptionptr = NULL;
-
- /* resolve methodinfo pointer from exception object */
-
-#if defined(ENABLE_JAVASE)
- m = class_resolvemethod(o->vftbl->class,
- utf_fillInStackTrace,
- utf_void__java_lang_Throwable);
-#elif defined(ENABLE_JAVAME_CLDC1_1)
- m = class_resolvemethod(o->vftbl->class,
- utf_fillInStackTrace,
- utf_void__void);
-#else
-#error IMPLEMENT ME!
-#endif
-
- /* call function */
-
- (void) vm_call_method(m, o);
-
- /* remove stackframeinfo */
-
- stacktrace_remove_stackframeinfo(&sfi);
-
- return o;
-}
-
-
-/* stacktrace_hardware_arithmeticexception *************************************
-
- Creates an ArithemticException for inline stub.
-
-*******************************************************************************/
-
-java_objectheader *stacktrace_hardware_arithmeticexception(u1 *pv, u1 *sp,
- u1 *ra, u1 *xpc)
-{
- stackframeinfo sfi;
- java_objectheader *o;
-
- /* create stackframeinfo */
-
- stacktrace_create_extern_stackframeinfo(&sfi, pv, sp, ra, xpc);
-
- /* create exception */
-
- o = exceptions_new_arithmeticexception();
-
- /* remove stackframeinfo */
-
- stacktrace_remove_stackframeinfo(&sfi);
-
- return o;
-}
-
-
-/* stacktrace_hardware_nullpointerexception ************************************
-
- Creates an NullPointerException for the SIGSEGV signal handler.
-
-*******************************************************************************/
-
-java_objectheader *stacktrace_hardware_nullpointerexception(u1 *pv, u1 *sp,
- u1 *ra, u1 *xpc)
-{
- stackframeinfo sfi;
- java_objectheader *o;
-
- /* create stackframeinfo */
-
- stacktrace_create_extern_stackframeinfo(&sfi, pv, sp, ra, xpc);
-
- /* create exception */
-
- o = exceptions_new_nullpointerexception();
-
- /* remove stackframeinfo */
-
- stacktrace_remove_stackframeinfo(&sfi);
-
- return o;
-}
-
-
/* stacktrace_add_entry ********************************************************
Adds a new entry to the stacktrace buffer.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: stacktrace.h 7409 2007-02-27 02:07:00Z ajordan $
+ $Id: stacktrace.h 7651 2007-04-03 14:00:32Z twisti $
*/
u1 *ra);
#endif
-void stacktrace_create_inline_stackframeinfo(stackframeinfo *sfi, u1 *pv,
- u1 *sp, u1 *ra, u1 *xpc);
-
void stacktrace_create_extern_stackframeinfo(stackframeinfo *sfi, u1 *pv,
u1 *sp, u1 *ra, u1 *xpc);
void stacktrace_remove_stackframeinfo(stackframeinfo *sfi);
-/* inline exception creating functions */
-java_objectheader *stacktrace_inline_arithmeticexception(u1 *pv, u1 *sp, u1 *ra,
- u1 *xpc);
-#define STACKTRACE_inline_arithmeticexception \
- (functionptr) stacktrace_inline_arithmeticexception
-
-
-java_objectheader *stacktrace_inline_arrayindexoutofboundsexception(u1 *pv,
- u1 *sp,
- u1 *ra,
- u1 *xpc,
- s4 index);
-#define STACKTRACE_inline_arrayindexoutofboundsexception \
- (functionptr) stacktrace_inline_arrayindexoutofboundsexception
-
-java_objectheader *stacktrace_inline_arraystoreexception(u1 *pv, u1 *sp, u1 *ra,
- u1 *xpc);
-#define STACKTRACE_inline_arraystoreexception \
- (functionptr) stacktrace_inline_arraystoreexception
-
-java_objectheader *stacktrace_inline_classcastexception(u1 *pv, u1 *sp, u1 *ra,
- u1 *xpc,
- java_objectheader *o);
-#define STACKTRACE_inline_classcastexception \
- (functionptr) stacktrace_inline_classcastexception
-
-java_objectheader *stacktrace_inline_nullpointerexception(u1 *pv, u1 *sp,
- u1 *ra, u1 *xpc);
-#define STACKTRACE_inline_nullpointerexception \
- (functionptr) stacktrace_inline_nullpointerexception
-
-/* refill the stacktrace of an existing exception */
-java_objectheader *stacktrace_inline_fillInStackTrace(u1 *pv, u1 *sp, u1 *ra,
- u1 *xpc);
-#define STACKTRACE_inline_fillInStackTrace \
- (functionptr) stacktrace_inline_fillInStackTrace
-
-
-/* hardware exception creating functions */
-java_objectheader *stacktrace_hardware_arithmeticexception(u1 *pv, u1 *sp,
- u1 *ra, u1 *xpc);
-
-java_objectheader *stacktrace_hardware_nullpointerexception(u1 *pv, u1 *sp,
- u1 *ra, u1 *xpc);
-
stacktracecontainer *stacktrace_fillInStackTrace(void);