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"); |
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 |