# HG changeset patch # User never # Date 1255476571 25200 # Node ID fcb148c6b6057feee899843ee02be93552759ef6 # Parent 354d3184f6b278bcdef18f6ea66dac4fcbcb41f6 6889302: TraceExceptions output should include detail message Reviewed-by: twisti, jrose, kvn diff -r 354d3184f6b2 -r fcb148c6b605 src/share/vm/utilities/exceptions.cpp --- a/src/share/vm/utilities/exceptions.cpp Tue Oct 13 12:04:21 2009 -0700 +++ b/src/share/vm/utilities/exceptions.cpp Tue Oct 13 16:29:31 2009 -0700 @@ -103,15 +103,18 @@ _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 @@ // 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 @@ 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 diff -r 354d3184f6b2 -r fcb148c6b605 src/share/vm/utilities/exceptions.hpp --- a/src/share/vm/utilities/exceptions.hpp Tue Oct 13 12:04:21 2009 -0700 +++ b/src/share/vm/utilities/exceptions.hpp Tue Oct 13 16:29:31 2009 -0700 @@ -103,7 +103,7 @@ } 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);