1.1 --- a/src/share/vm/utilities/exceptions.cpp Tue Oct 13 12:04:21 2009 -0700 1.2 +++ b/src/share/vm/utilities/exceptions.cpp Tue Oct 13 16:29:31 2009 -0700 1.3 @@ -103,15 +103,18 @@ 1.4 _throw(thread, file, line, h_exception); 1.5 } 1.6 1.7 -void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception) { 1.8 +void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) { 1.9 assert(h_exception() != NULL, "exception should not be NULL"); 1.10 1.11 // tracing (do this up front - so it works during boot strapping) 1.12 if (TraceExceptions) { 1.13 ttyLocker ttyl; 1.14 ResourceMark rm; 1.15 - tty->print_cr("Exception <%s> (" INTPTR_FORMAT " ) \nthrown [%s, line %d]\nfor thread " INTPTR_FORMAT, 1.16 - h_exception->print_value_string(), (address)h_exception(), file, line, thread); 1.17 + tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n" 1.18 + "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT, 1.19 + h_exception->print_value_string(), 1.20 + message ? ": " : "", message ? message : "", 1.21 + (address)h_exception(), file, line, thread); 1.22 } 1.23 // for AbortVMOnException flag 1.24 NOT_PRODUCT(Exceptions::debug_check_abort(h_exception)); 1.25 @@ -135,7 +138,7 @@ 1.26 // Create and throw exception 1.27 Handle h_cause(thread, NULL); 1.28 Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain); 1.29 - _throw(thread, file, line, h_exception); 1.30 + _throw(thread, file, line, h_exception, message); 1.31 } 1.32 1.33 // Throw an exception with a message and a cause 1.34 @@ -144,7 +147,7 @@ 1.35 if (special_exception(thread, file, line, h_name, message)) return; 1.36 // Create and throw exception and init cause 1.37 Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain); 1.38 - _throw(thread, file, line, h_exception); 1.39 + _throw(thread, file, line, h_exception, message); 1.40 } 1.41 1.42 // This version creates handles and calls the other version