diff -r edc4431940b2 -r 5ec6ffa63c57 hotspot/src/share/vm/utilities/exceptions.cpp --- a/hotspot/src/share/vm/utilities/exceptions.cpp Wed Oct 14 13:30:47 2015 -0400 +++ b/hotspot/src/share/vm/utilities/exceptions.cpp Wed Oct 14 15:36:41 2015 -0700 @@ -145,7 +145,7 @@ p2i(h_exception()), file, line, p2i(thread)); } // for AbortVMOnException flag - NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message)); + Exceptions::debug_check_abort(h_exception, message); // Check for special boot-strapping/vm-thread handling if (special_exception(thread, file, line, h_exception)) { @@ -477,13 +477,12 @@ // ---------------------------------------------------------------------------------------- -#ifndef PRODUCT // caller frees value_string if necessary void Exceptions::debug_check_abort(const char *value_string, const char* message) { if (AbortVMOnException != NULL && value_string != NULL && strstr(value_string, AbortVMOnException)) { - if (AbortVMOnExceptionMessage == NULL || message == NULL || - strcmp(message, AbortVMOnExceptionMessage) == 0) { + if (AbortVMOnExceptionMessage == NULL || (message != NULL && + strstr(message, AbortVMOnExceptionMessage))) { fatal("Saw %s, aborting", value_string); } } @@ -491,14 +490,17 @@ void Exceptions::debug_check_abort(Handle exception, const char* message) { if (AbortVMOnException != NULL) { - ResourceMark rm; - if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) { - oop msg = java_lang_Throwable::message(exception); - if (msg != NULL) { - message = java_lang_String::as_utf8_string(msg); - } - } - debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message); + debug_check_abort_helper(exception, message); } } -#endif + +void Exceptions::debug_check_abort_helper(Handle exception, const char* message) { + ResourceMark rm; + if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) { + oop msg = java_lang_Throwable::message(exception); + if (msg != NULL) { + message = java_lang_String::as_utf8_string(msg); + } + } + debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message); +}