63 #define DEBUG_NAME "exceptions"
111 LOG(
"[exceptions_set_exception : t=" << (
void *) t
112 <<
", o=" << (
void *) o
133 LOG(
"[exceptions_clear_exception: t=" << (
void *) t <<
cacao::nl);
177 log_println(
"exception thrown while VM is initializing: ");
182 if (message != NULL) {
402 utf8::java_lang_Throwable__void,
452 utf8::java_lang_Exception__V,
499 utf8::java_lang_String__void,
512 utf8::java_lang_Throwable__java_lang_Throwable,
568 #if defined(ENABLE_JAVAME_CLDC1_1)
647 va_start(ap, message);
734 .
write(
" (wrong name: ", 14)
812 va_start(ap, message);
900 #if defined(ENABLE_JAVASE)
933 #if defined(ENABLE_JAVASE)
981 buf.
write(
"(class: ")
985 .
write(
" signature: ")
990 va_start(ap, message);
1021 buf.
write(
"(class: ")
1023 .
write(
", method: ")
1025 .
write(
" signature: ")
1030 buf.
write(
"Expecting to find ");
1039 default: buf.
write(
"<INVALID>"); assert(0);
break;
1042 buf.
write(
" on stack");
1061 utf8::division_by_zero);
1332 #if defined(ENABLE_JAVASE)
1334 utf8::fillInStackTrace,
1335 utf8::void__java_lang_Throwable);
1336 #elif defined(ENABLE_JAVAME_CLDC1_1)
1338 utf8::fillInStackTrace,
1341 #error IMPLEMENT ME!
1372 #if defined(ENABLE_JIT)
1388 # define ADDR_MASK(x) (void *) ((uintptr_t) (x) & 0x7FFFFFFF)
1390 # define ADDR_MASK(x) (x)
1412 goto exceptions_handle_exception_return;
1417 #if !defined(NDEBUG)
1433 for (i = 0; i < et->
length; i++, ete++) {
1441 if (cr.
any == NULL) {
1442 #if !defined(NDEBUG)
1452 goto exceptions_handle_exception_return;
1472 goto exceptions_handle_exception_return;
1489 goto exceptions_handle_exception_return;
1496 goto exceptions_handle_exception_return;
1502 #if !defined(NDEBUG)
1512 goto exceptions_handle_exception_return;
1532 #if !defined(NDEBUG)
1534 # if defined(ENABLE_DEBUG_FILTER)
1544 log_text(
"exceptions_handle_exception: WARNING: unmatched unindent");
1547 # if defined(ENABLE_DEBUG_FILTER)
1554 exceptions_handle_exception_return:
1581 #if defined(ENABLE_JAVASE)
1592 if (!jls.is_null()) {
1601 #if defined(ENABLE_JAVASE)
1605 if ((!jltcause.is_null()) && (jltcause.get_handle() != jlt.
get_handle())) {
1608 c = jltcause.get_Class();
1613 if (jlscause.get_handle() != NULL) {
1683 utf8::printStackTrace,
1689 os::abort(
"exceptions_print_stacktrace: printStackTrace()V not found");
1693 fprintf(stderr,
"Exception ");
1702 fprintf(stderr,
"in thread \"");
1704 fprintf(stderr,
"\" ");
1719 fprintf(stderr,
"Exception while printStackTrace(): ");
1728 fprintf(stderr,
"Original exception was: ");
1734 fprintf(stderr,
". Uncaught exception of type ");
1735 #if !defined(NDEBUG)
1739 fprintf(stderr,
"UNKNOWN");
1741 fprintf(stderr,
".");
1749 #if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
void exceptions_throw_verifyerror(methodinfo *m, const char *message,...)
void exceptions_throw_illegalargumentexception(void)
void exceptions_throw_noclassdeffounderror_wrong_name(classinfo *c, Utf8String name)
bool builtin_instanceof(java_handle_t *o, classinfo *c)
Utf8String utf8_str()
get utf-8 string contents of buffer as utf8-string
java_handle_t * exceptions_new_arraystoreexception(void)
static java_handle_t * exceptions_new_utf_utf(Utf8String classname, Utf8String message)
methodinfo * class_resolveclassmethod(classinfo *c, Utf8String name, Utf8String desc, classinfo *referer, bool throwexception)
void exceptions_print_stacktrace(void)
virtual java_handle_t * get_handle() const
void exceptions_throw_illegalmonitorstateexception(void)
static void exceptions_throw_utf_cause(Utf8String classname, java_handle_t *cause)
void exceptions_throw_linkageerror(const char *message, classinfo *c)
void exceptions_throw_arraystoreexception(void)
void exceptions_throw_classnotfoundexception(Utf8String name)
void exceptions_throw_nosuchmethoderror(classinfo *c, Utf8String name, Utf8String desc)
static Utf8String from_utf8_slash_to_dot(const char *, size_t)
static JavaString from_utf8(Utf8String)
void class_print(classinfo *c)
void utf_display_printable_ascii_classname(Utf8String u)
void exceptions_throw_exceptionininitializererror(java_handle_t *cause)
static Utf8String get_classname_for_exception(classinfo *c)
void exceptions_throw_interruptedexception(void)
classloader_t * classloader
void exceptions_throw_clonenotsupportedexception(void)
void exceptions_throw_nosuchfielderror(classinfo *c, Utf8String name)
void exceptions_throw_classcircularityerror(classinfo *c)
typedef void(JNICALL *jvmtiEventSingleStep)(jvmtiEnv *jvmti_env
bool lock_monitor_exit(java_handle_t *o)
void exceptions_throw_instantiationerror(classinfo *c)
classinfo * get_Class() const
classinfo * load_class_bootstrap(Utf8String name)
#define LLNI_CRITICAL_END
java_handle_t * exceptions_new_nullpointerexception(void)
java_handle_t * vm_call_method(methodinfo *m, java_handle_t *o,...)
void exceptions_throw_classformaterror(classinfo *c, const char *message,...)
void stacktrace_print_exception(java_handle_t *h)
JNIEnv jclass jobject const char * name
classinfo * class_java_lang_Object
void log_println(const char *text,...)
Buffer & write_slash_to_dot(const char *)
write to buffer, replacing '/' by '.'
void exceptions_throw_noclassdeffounderror(Utf8String name)
#define exceptions_handle_exception
java_handle_t * builtin_new(classinfo *c)
java_handle_t * exceptions_new_classcastexception(java_handle_t *o)
static java_handle_t * exceptions_new_utf(Utf8String classname)
cacao::ClassFileVersion version
#define LLNI_class_get(obj, variable)
#define LLNI_QUICKWRAP(obj)
void log_print(const char *text,...)
exceptiontable_t * exceptiontable
java_handle_t * exceptions_new_arrayindexoutofboundsexception(s4 index)
JNIEnv jthread jmethodID jlocation jobject exception
static void exceptions_abort(Utf8String classname, Utf8String message)
java_object_t * _exceptionptr
void exceptions_print_current_exception(void)
void exceptions_set_exception(java_handle_t *e)
void exceptions_throw_incompatibleclasschangeerror(classinfo *c, const char *message)
int show_filters_test_verbosecall_exit(methodinfo *m)
void exceptions_throw_instantiationexception(classinfo *c)
void exceptions_throw_nullpointerexception(void)
methodinfo * class_resolvemethod(classinfo *c, Utf8String name, Utf8String desc)
static codeinfo * code_get_codeinfo_for_pv(void *pv)
void exceptions_throw_abstractmethoderror(void)
void exceptions_throw_internalerror(const char *message,...)
void thread_fprint_name(threadobject *t, FILE *stream)
#define exceptions_get_and_clear_exception
static Utf8String from_utf8(const char *, size_t)
void stacktrace_stackframeinfo_add(stackframeinfo_t *sfi, void *pv, void *sp, void *ra, void *xpc)
GNU Classpath java/lang/Throwable.
static void exceptions_throw_utf_throwable(Utf8String classname, java_handle_t *cause)
void exceptions_throw_negativearraysizeexception(void)
void exceptions_throw_privilegedactionexception(java_handle_t *exception)
#define LOG(STMT)
Analogous to DEBUG.
java_handle_t * native_new_and_init(classinfo *c)
Registers a new native agent by specified by it's library name and with an optional options string...
void exceptions_throw_arrayindexoutofboundsexception(void)
void exceptions_throw_illegalaccessexception(Utf8String message)
classinfo * class_java_lang_String
byte_iterator begin() const
GNU Classpath java/lang/String.
void fprint_printable_ascii(FILE *) const
static threadobject * thread_get_current()
Return the threadobject for the current thread.
int32_t synchronizedoffset
void stacktrace_stackframeinfo_remove(stackframeinfo_t *sfi)
static java_handle_t * exceptions_new_class_utf(classinfo *c, Utf8String message)
Buffer & writevf(const char *fmt, va_list ap)
java_handle_t * exceptions_fillinstacktrace(void)
classinfo * link_class(classinfo *c)
classref_or_classinfo catchtype
static void exceptions_throw_utf_utf(Utf8String classname, Utf8String message)
#define LLNI_CRITICAL_START
void exceptions_clear_exception(void)
java_handle_t * get_cause() const
void exceptions_throw_unsupportedclassversionerror(classinfo *c)
static void exceptions_throw_utf_exception(Utf8String classname, java_handle_t *exception)
#define TRACEJAVACALLINDENT
static int code_is_synchronized(codeinfo *code)
java_handle_t * exceptions_get_exception(void)
void exceptions_throw_noclassdeffounderror_cause(java_handle_t *cause)
java_handle_t * get_detailMessage() const
GNU Classpath java/lang/Thread.
classinfo * load_class_from_classloader(Utf8String name, classloader_t *cl)
void exceptions_throw_invocationtargetexception(java_handle_t *cause)
java_handle_t * native_new_and_init_string(classinfo *c, java_handle_t *s)
classinfo * resolve_classref_eager(constant_classref *ref)
Buffer & writef(const char *fmt,...)
void exceptions_print_exception(java_handle_t *xptr)
void asm_vm_call_method_exception_handler(void)
void exceptions_throw_verifyerror_for_stack(methodinfo *m, int type)
void exceptions_throw_unsatisfiedlinkerror(Utf8String name)
static void exceptions_throw_utf(Utf8String classname)
static java_handle_t * exceptions_new_utf_javastring(Utf8String classname, java_handle_t *message)
void trace_exception(java_object_t *xptr, methodinfo *m, void *pos)
java_handle_t * exceptions_new_abstractmethoderror(void)
classinfo * class_java_lang_Throwable
java_handle_t * exceptions_new_arithmeticexception(void)
exceptiontable_entry_t * entries
void exceptions_throw_outofmemoryerror(void)
void exceptions_throw_stringindexoutofboundsexception(void)
static VM * get_current()