comparison src/share/vm/utilities/exceptions.cpp @ 1011:fcb148c6b605

6889302: TraceExceptions output should include detail message Reviewed-by: twisti, jrose, kvn
author never
date Tue, 13 Oct 2009 16:29:31 -0700
parents a61af66fc99e
children 4ce7240d622c
comparison
equal deleted inserted replaced
1010:354d3184f6b2 1011:fcb148c6b605
101 assert(exception != NULL, "exception should not be NULL"); 101 assert(exception != NULL, "exception should not be NULL");
102 Handle h_exception = Handle(thread, exception); 102 Handle h_exception = Handle(thread, exception);
103 _throw(thread, file, line, h_exception); 103 _throw(thread, file, line, h_exception);
104 } 104 }
105 105
106 void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception) { 106 void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) {
107 assert(h_exception() != NULL, "exception should not be NULL"); 107 assert(h_exception() != NULL, "exception should not be NULL");
108 108
109 // tracing (do this up front - so it works during boot strapping) 109 // tracing (do this up front - so it works during boot strapping)
110 if (TraceExceptions) { 110 if (TraceExceptions) {
111 ttyLocker ttyl; 111 ttyLocker ttyl;
112 ResourceMark rm; 112 ResourceMark rm;
113 tty->print_cr("Exception <%s> (" INTPTR_FORMAT " ) \nthrown [%s, line %d]\nfor thread " INTPTR_FORMAT, 113 tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n"
114 h_exception->print_value_string(), (address)h_exception(), file, line, thread); 114 "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
115 h_exception->print_value_string(),
116 message ? ": " : "", message ? message : "",
117 (address)h_exception(), file, line, thread);
115 } 118 }
116 // for AbortVMOnException flag 119 // for AbortVMOnException flag
117 NOT_PRODUCT(Exceptions::debug_check_abort(h_exception)); 120 NOT_PRODUCT(Exceptions::debug_check_abort(h_exception));
118 121
119 // Check for special boot-strapping/vm-thread handling 122 // Check for special boot-strapping/vm-thread handling
133 // Check for special boot-strapping/vm-thread handling 136 // Check for special boot-strapping/vm-thread handling
134 if (special_exception(thread, file, line, h_name, message)) return; 137 if (special_exception(thread, file, line, h_name, message)) return;
135 // Create and throw exception 138 // Create and throw exception
136 Handle h_cause(thread, NULL); 139 Handle h_cause(thread, NULL);
137 Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain); 140 Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain);
138 _throw(thread, file, line, h_exception); 141 _throw(thread, file, line, h_exception, message);
139 } 142 }
140 143
141 // Throw an exception with a message and a cause 144 // Throw an exception with a message and a cause
142 void Exceptions::_throw_msg_cause(Thread* thread, const char* file, int line, symbolHandle h_name, const char* message, Handle h_cause, Handle h_loader, Handle h_protection_domain) { 145 void Exceptions::_throw_msg_cause(Thread* thread, const char* file, int line, symbolHandle h_name, const char* message, Handle h_cause, Handle h_loader, Handle h_protection_domain) {
143 // Check for special boot-strapping/vm-thread handling 146 // Check for special boot-strapping/vm-thread handling
144 if (special_exception(thread, file, line, h_name, message)) return; 147 if (special_exception(thread, file, line, h_name, message)) return;
145 // Create and throw exception and init cause 148 // Create and throw exception and init cause
146 Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain); 149 Handle h_exception = new_exception(thread, h_name, message, h_cause, h_loader, h_protection_domain);
147 _throw(thread, file, line, h_exception); 150 _throw(thread, file, line, h_exception, message);
148 } 151 }
149 152
150 // This version creates handles and calls the other version 153 // This version creates handles and calls the other version
151 void Exceptions::_throw_msg(Thread* thread, const char* file, int line, 154 void Exceptions::_throw_msg(Thread* thread, const char* file, int line,
152 symbolOop name, const char* message) { 155 symbolOop name, const char* message) {