hotspot/src/share/vm/utilities/exceptions.cpp
changeset 33208 5ec6ffa63c57
parent 33148 68fa8b6c4340
child 33230 23bb11a5cf4e
equal deleted inserted replaced
33207:edc4431940b2 33208:5ec6ffa63c57
   143                   h_exception->print_value_string(),
   143                   h_exception->print_value_string(),
   144                   message ? ": " : "", message ? message : "",
   144                   message ? ": " : "", message ? message : "",
   145                   p2i(h_exception()), file, line, p2i(thread));
   145                   p2i(h_exception()), file, line, p2i(thread));
   146   }
   146   }
   147   // for AbortVMOnException flag
   147   // for AbortVMOnException flag
   148   NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message));
   148   Exceptions::debug_check_abort(h_exception, message);
   149 
   149 
   150   // Check for special boot-strapping/vm-thread handling
   150   // Check for special boot-strapping/vm-thread handling
   151   if (special_exception(thread, file, line, h_exception)) {
   151   if (special_exception(thread, file, line, h_exception)) {
   152     return;
   152     return;
   153   }
   153   }
   475   }
   475   }
   476 }
   476 }
   477 
   477 
   478 // ----------------------------------------------------------------------------------------
   478 // ----------------------------------------------------------------------------------------
   479 
   479 
   480 #ifndef PRODUCT
       
   481 // caller frees value_string if necessary
   480 // caller frees value_string if necessary
   482 void Exceptions::debug_check_abort(const char *value_string, const char* message) {
   481 void Exceptions::debug_check_abort(const char *value_string, const char* message) {
   483   if (AbortVMOnException != NULL && value_string != NULL &&
   482   if (AbortVMOnException != NULL && value_string != NULL &&
   484       strstr(value_string, AbortVMOnException)) {
   483       strstr(value_string, AbortVMOnException)) {
   485     if (AbortVMOnExceptionMessage == NULL || message == NULL ||
   484     if (AbortVMOnExceptionMessage == NULL || (message != NULL &&
   486         strcmp(message, AbortVMOnExceptionMessage) == 0) {
   485         strstr(message, AbortVMOnExceptionMessage))) {
   487       fatal("Saw %s, aborting", value_string);
   486       fatal("Saw %s, aborting", value_string);
   488     }
   487     }
   489   }
   488   }
   490 }
   489 }
   491 
   490 
   492 void Exceptions::debug_check_abort(Handle exception, const char* message) {
   491 void Exceptions::debug_check_abort(Handle exception, const char* message) {
   493   if (AbortVMOnException != NULL) {
   492   if (AbortVMOnException != NULL) {
   494     ResourceMark rm;
   493     debug_check_abort_helper(exception, message);
   495     if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) {
   494   }
   496       oop msg = java_lang_Throwable::message(exception);
   495 }
   497       if (msg != NULL) {
   496 
   498         message = java_lang_String::as_utf8_string(msg);
   497 void Exceptions::debug_check_abort_helper(Handle exception, const char* message) {
   499       }
   498   ResourceMark rm;
   500     }
   499   if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) {
   501     debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message);
   500     oop msg = java_lang_Throwable::message(exception);
   502   }
   501     if (msg != NULL) {
   503 }
   502       message = java_lang_String::as_utf8_string(msg);
   504 #endif
   503     }
       
   504   }
       
   505   debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message);
       
   506 }