hotspot/src/share/vm/utilities/exceptions.cpp
changeset 4014 b59b8c387950
parent 1 489c9b5090e2
child 4571 80b553bddc26
--- a/hotspot/src/share/vm/utilities/exceptions.cpp	Tue Oct 13 12:04:21 2009 -0700
+++ b/hotspot/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