6889302: TraceExceptions output should include detail message
Reviewed-by: twisti, jrose, kvn
This commit is contained in:
parent
5473f394c6
commit
9ecd8e48ca
hotspot/src/share/vm/utilities
@ -103,15 +103,18 @@ void Exceptions::_throw_oop(Thread* thread, const char* file, int line, oop exce
|
||||
_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");
|
||||
|
||||
// tracing (do this up front - so it works during boot strapping)
|
||||
if (TraceExceptions) {
|
||||
ttyLocker ttyl;
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Exception <%s> (" INTPTR_FORMAT " ) \nthrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
|
||||
h_exception->print_value_string(), (address)h_exception(), file, line, thread);
|
||||
tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n"
|
||||
"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
|
||||
NOT_PRODUCT(Exceptions::debug_check_abort(h_exception));
|
||||
@ -135,7 +138,7 @@ void Exceptions::_throw_msg(Thread* thread, const char* file, int line, symbolHa
|
||||
// Create and throw exception
|
||||
Handle h_cause(thread, NULL);
|
||||
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
|
||||
@ -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;
|
||||
// Create and throw exception and init cause
|
||||
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
|
||||
|
@ -103,7 +103,7 @@ class Exceptions {
|
||||
} ExceptionMsgToUtf8Mode;
|
||||
// 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(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,
|
||||
symbolHandle name, const char* message, Handle loader,
|
||||
Handle protection_domain);
|
||||
|
Loading…
x
Reference in New Issue
Block a user