hotspot/src/share/vm/utilities/exceptions.cpp
changeset 6179 4846648c4b7b
parent 5547 f4b087cbb361
child 6964 6e45ffa3bccf
equal deleted inserted replaced
6178:bfbfaacd23e5 6179:4846648c4b7b
   115                   h_exception->print_value_string(),
   115                   h_exception->print_value_string(),
   116                   message ? ": " : "", message ? message : "",
   116                   message ? ": " : "", message ? message : "",
   117                   (address)h_exception(), file, line, thread);
   117                   (address)h_exception(), file, line, thread);
   118   }
   118   }
   119   // for AbortVMOnException flag
   119   // for AbortVMOnException flag
   120   NOT_PRODUCT(Exceptions::debug_check_abort(h_exception));
   120   NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message));
   121 
   121 
   122   // Check for special boot-strapping/vm-thread handling
   122   // Check for special boot-strapping/vm-thread handling
   123   if (special_exception(thread, file, line, h_exception)) return;
   123   if (special_exception(thread, file, line, h_exception)) return;
   124 
   124 
   125   assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
   125   assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
   373 
   373 
   374 // ----------------------------------------------------------------------------------------
   374 // ----------------------------------------------------------------------------------------
   375 
   375 
   376 #ifndef PRODUCT
   376 #ifndef PRODUCT
   377 // caller frees value_string if necessary
   377 // caller frees value_string if necessary
   378 void Exceptions::debug_check_abort(const char *value_string) {
   378 void Exceptions::debug_check_abort(const char *value_string, const char* message) {
   379   if (AbortVMOnException != NULL && value_string != NULL &&
   379   if (AbortVMOnException != NULL && value_string != NULL &&
   380       strstr(value_string, AbortVMOnException)) {
   380       strstr(value_string, AbortVMOnException)) {
   381     fatal(err_msg("Saw %s, aborting", value_string));
   381     if (AbortVMOnExceptionMessage == NULL || message == NULL ||
   382   }
   382         strcmp(message, AbortVMOnExceptionMessage) == 0) {
   383 }
   383       fatal(err_msg("Saw %s, aborting", value_string));
   384 
   384     }
   385 void Exceptions::debug_check_abort(Handle exception) {
   385   }
       
   386 }
       
   387 
       
   388 void Exceptions::debug_check_abort(Handle exception, const char* message) {
   386   if (AbortVMOnException != NULL) {
   389   if (AbortVMOnException != NULL) {
   387     ResourceMark rm;
   390     ResourceMark rm;
   388     debug_check_abort(instanceKlass::cast(exception()->klass())->external_name());
   391     if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) {
       
   392       oop msg = java_lang_Throwable::message(exception);
       
   393       if (msg != NULL) {
       
   394         message = java_lang_String::as_utf8_string(msg);
       
   395       }
       
   396     }
       
   397     debug_check_abort(instanceKlass::cast(exception()->klass())->external_name(), message);
   389   }
   398   }
   390 }
   399 }
   391 #endif
   400 #endif