< prev index next >

src/share/vm/utilities/exceptions.cpp

Print this page




 469     Handle exception(_thread, _thread->pending_exception());
 470     _thread->clear_pending_exception(); // Needed to avoid infinite recursion
 471     if (is_init_completed()) {
 472       exception->print();
 473       fatal("ExceptionMark destructor expects no pending exceptions");
 474     } else {
 475       vm_exit_during_initialization(exception);
 476     }
 477   }
 478 }
 479 
 480 // ----------------------------------------------------------------------------------------
 481 
 482 #ifndef PRODUCT
 483 // caller frees value_string if necessary
 484 void Exceptions::debug_check_abort(const char *value_string, const char* message) {
 485   if (AbortVMOnException != NULL && value_string != NULL &&
 486       strstr(value_string, AbortVMOnException)) {
 487     if (AbortVMOnExceptionMessage == NULL || message == NULL ||
 488         strcmp(message, AbortVMOnExceptionMessage) == 0) {
 489       fatal(err_msg("Saw %s, aborting", value_string));
 490     }
 491   }
 492 }
 493 
 494 void Exceptions::debug_check_abort(Handle exception, const char* message) {
 495   if (AbortVMOnException != NULL) {
 496     ResourceMark rm;
 497     if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) {
 498       oop msg = java_lang_Throwable::message(exception);
 499       if (msg != NULL) {
 500         message = java_lang_String::as_utf8_string(msg);
 501       }
 502     }
 503     debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message);
 504   }
 505 }
 506 #endif


 469     Handle exception(_thread, _thread->pending_exception());
 470     _thread->clear_pending_exception(); // Needed to avoid infinite recursion
 471     if (is_init_completed()) {
 472       exception->print();
 473       fatal("ExceptionMark destructor expects no pending exceptions");
 474     } else {
 475       vm_exit_during_initialization(exception);
 476     }
 477   }
 478 }
 479 
 480 // ----------------------------------------------------------------------------------------
 481 
 482 #ifndef PRODUCT
 483 // caller frees value_string if necessary
 484 void Exceptions::debug_check_abort(const char *value_string, const char* message) {
 485   if (AbortVMOnException != NULL && value_string != NULL &&
 486       strstr(value_string, AbortVMOnException)) {
 487     if (AbortVMOnExceptionMessage == NULL || message == NULL ||
 488         strcmp(message, AbortVMOnExceptionMessage) == 0) {
 489       fatal("Saw %s, aborting", value_string);
 490     }
 491   }
 492 }
 493 
 494 void Exceptions::debug_check_abort(Handle exception, const char* message) {
 495   if (AbortVMOnException != NULL) {
 496     ResourceMark rm;
 497     if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) {
 498       oop msg = java_lang_Throwable::message(exception);
 499       if (msg != NULL) {
 500         message = java_lang_String::as_utf8_string(msg);
 501       }
 502     }
 503     debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message);
 504   }
 505 }
 506 #endif
< prev index next >