提交 4462ca1f 编写于 作者: N never

6889302: TraceExceptions output should include detail message

Reviewed-by: twisti, jrose, kvn
上级 3fecd1b0
...@@ -103,15 +103,18 @@ void Exceptions::_throw_oop(Thread* thread, const char* file, int line, oop exce ...@@ -103,15 +103,18 @@ void Exceptions::_throw_oop(Thread* thread, const char* file, int line, oop exce
_throw(thread, file, line, h_exception); _throw(thread, file, line, h_exception);
} }
void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception) { void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) {
assert(h_exception() != NULL, "exception should not be NULL"); assert(h_exception() != NULL, "exception should not be NULL");
// tracing (do this up front - so it works during boot strapping) // tracing (do this up front - so it works during boot strapping)
if (TraceExceptions) { if (TraceExceptions) {
ttyLocker ttyl; ttyLocker ttyl;
ResourceMark rm; ResourceMark rm;
tty->print_cr("Exception <%s> (" INTPTR_FORMAT " ) \nthrown [%s, line %d]\nfor thread " INTPTR_FORMAT, tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n"
h_exception->print_value_string(), (address)h_exception(), file, line, thread); "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
h_exception->print_value_string(),
message ? ": " : "", message ? message : "",
(address)h_exception(), file, line, thread);
} }
// for AbortVMOnException flag // for AbortVMOnException flag
NOT_PRODUCT(Exceptions::debug_check_abort(h_exception)); NOT_PRODUCT(Exceptions::debug_check_abort(h_exception));
...@@ -135,7 +138,7 @@ void Exceptions::_throw_msg(Thread* thread, const char* file, int line, symbolHa ...@@ -135,7 +138,7 @@ void Exceptions::_throw_msg(Thread* thread, const char* file, int line, symbolHa
// Create and throw exception // Create and throw exception
Handle h_cause(thread, NULL); Handle h_cause(thread, NULL);
Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain); Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain);
_throw(thread, file, line, h_exception); _throw(thread, file, line, h_exception, message);
} }
// Throw an exception with a message and a cause // Throw an exception with a message and a cause
...@@ -144,7 +147,7 @@ void Exceptions::_throw_msg_cause(Thread* thread, const char* file, int line, sy ...@@ -144,7 +147,7 @@ void Exceptions::_throw_msg_cause(Thread* thread, const char* file, int line, sy
if (special_exception(thread, file, line, h_name, message)) return; if (special_exception(thread, file, line, h_name, message)) return;
// Create and throw exception and init cause // Create and throw exception and init cause
Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain); Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain);
_throw(thread, file, line, h_exception); _throw(thread, file, line, h_exception, message);
} }
// This version creates handles and calls the other version // This version creates handles and calls the other version
......
...@@ -103,7 +103,7 @@ class Exceptions { ...@@ -103,7 +103,7 @@ class Exceptions {
} ExceptionMsgToUtf8Mode; } ExceptionMsgToUtf8Mode;
// Throw exceptions: w/o message, w/ message & with formatted message. // Throw exceptions: w/o message, w/ message & with formatted message.
static void _throw_oop(Thread* thread, const char* file, int line, oop exception); static void _throw_oop(Thread* thread, const char* file, int line, oop exception);
static void _throw(Thread* thread, const char* file, int line, Handle exception); static void _throw(Thread* thread, const char* file, int line, Handle exception, const char* msg = NULL);
static void _throw_msg(Thread* thread, const char* file, int line, static void _throw_msg(Thread* thread, const char* file, int line,
symbolHandle name, const char* message, Handle loader, symbolHandle name, const char* message, Handle loader,
Handle protection_domain); Handle protection_domain);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册