hotspot/src/share/vm/utilities/debug.cpp
changeset 34633 2a6c7c7b30a7
parent 34144 b181699c6616
child 34670 5ab871b40190
equal deleted inserted replaced
34632:bf3518bba285 34633:2a6c7c7b30a7
   213 void report_vm_error(const char* file, int line, const char* error_msg, const char* detail_fmt, ...)
   213 void report_vm_error(const char* file, int line, const char* error_msg, const char* detail_fmt, ...)
   214 {
   214 {
   215   if (Debugging || error_is_suppressed(file, line)) return;
   215   if (Debugging || error_is_suppressed(file, line)) return;
   216   va_list detail_args;
   216   va_list detail_args;
   217   va_start(detail_args, detail_fmt);
   217   va_start(detail_args, detail_fmt);
   218   VMError::report_and_die(ThreadLocalStorage::get_thread_slow(), file, line, error_msg, detail_fmt, detail_args);
   218   VMError::report_and_die(Thread::current_or_null(), file, line, error_msg, detail_fmt, detail_args);
   219   va_end(detail_args);
   219   va_end(detail_args);
   220 }
   220 }
   221 
   221 
   222 void report_fatal(const char* file, int line, const char* detail_fmt, ...)
   222 void report_fatal(const char* file, int line, const char* detail_fmt, ...)
   223 {
   223 {
   224   if (Debugging || error_is_suppressed(file, line)) return;
   224   if (Debugging || error_is_suppressed(file, line)) return;
   225   va_list detail_args;
   225   va_list detail_args;
   226   va_start(detail_args, detail_fmt);
   226   va_start(detail_args, detail_fmt);
   227   VMError::report_and_die(ThreadLocalStorage::get_thread_slow(), file, line, "fatal error", detail_fmt, detail_args);
   227   VMError::report_and_die(Thread::current_or_null(), file, line, "fatal error", detail_fmt, detail_args);
   228   va_end(detail_args);
   228   va_end(detail_args);
   229 }
   229 }
   230 
   230 
   231 void report_vm_out_of_memory(const char* file, int line, size_t size,
   231 void report_vm_out_of_memory(const char* file, int line, size_t size,
   232                              VMErrorType vm_err_type, const char* detail_fmt, ...) {
   232                              VMErrorType vm_err_type, const char* detail_fmt, ...) {
   233   if (Debugging) return;
   233   if (Debugging) return;
   234   va_list detail_args;
   234   va_list detail_args;
   235   va_start(detail_args, detail_fmt);
   235   va_start(detail_args, detail_fmt);
   236   VMError::report_and_die(ThreadLocalStorage::get_thread_slow(), file, line, size, vm_err_type, detail_fmt, detail_args);
   236   VMError::report_and_die(Thread::current_or_null(), file, line, size, vm_err_type, detail_fmt, detail_args);
   237   va_end(detail_args);
   237   va_end(detail_args);
   238 
   238 
   239   // The UseOSErrorReporting option in report_and_die() may allow a return
   239   // The UseOSErrorReporting option in report_and_die() may allow a return
   240   // to here. If so then we'll have to figure out how to handle it.
   240   // to here. If so then we'll have to figure out how to handle it.
   241   guarantee(false, "report_and_die() should not return here");
   241   guarantee(false, "report_and_die() should not return here");
   534 extern "C" void findpc(intptr_t x);
   534 extern "C" void findpc(intptr_t x);
   535 
   535 
   536 #endif // !PRODUCT
   536 #endif // !PRODUCT
   537 
   537 
   538 extern "C" void ps() { // print stack
   538 extern "C" void ps() { // print stack
   539   if (Thread::current() == NULL) return;
   539   if (Thread::current_or_null() == NULL) return;
   540   Command c("ps");
   540   Command c("ps");
   541 
   541 
   542 
   542 
   543   // Prints the stack of the current Java thread
   543   // Prints the stack of the current Java thread
   544   JavaThread* p = JavaThread::active();
   544   JavaThread* p = JavaThread::active();
   613 }
   613 }
   614 
   614 
   615 #endif // !PRODUCT
   615 #endif // !PRODUCT
   616 
   616 
   617 extern "C" void pss() { // print all stacks
   617 extern "C" void pss() { // print all stacks
   618   if (Thread::current() == NULL) return;
   618   if (Thread::current_or_null() == NULL) return;
   619   Command c("pss");
   619   Command c("pss");
   620   Threads::print(true, PRODUCT_ONLY(false) NOT_PRODUCT(true));
   620   Threads::print(true, PRODUCT_ONLY(false) NOT_PRODUCT(true));
   621 }
   621 }
   622 
   622 
   623 #ifndef PRODUCT
   623 #ifndef PRODUCT
   770 #ifndef PRODUCT
   770 #ifndef PRODUCT
   771 
   771 
   772 extern "C" void pns(void* sp, void* fp, void* pc) { // print native stack
   772 extern "C" void pns(void* sp, void* fp, void* pc) { // print native stack
   773   Command c("pns");
   773   Command c("pns");
   774   static char buf[O_BUFLEN];
   774   static char buf[O_BUFLEN];
   775   Thread* t = ThreadLocalStorage::get_thread_slow();
   775   Thread* t = Thread::current_or_null();
   776   // Call generic frame constructor (certain arguments may be ignored)
   776   // Call generic frame constructor (certain arguments may be ignored)
   777   frame fr(sp, fp, pc);
   777   frame fr(sp, fp, pc);
   778   print_native_stack(tty, fr, t, buf, sizeof(buf));
   778   print_native_stack(tty, fr, t, buf, sizeof(buf));
   779 }
   779 }
   780 
   780