400 thread->set_thread_state(_thread_in_vm);
401 if (ShowMessageBoxOnError) {
402 JavaThread* thread = JavaThread::current();
403 JavaThreadState saved_state = thread->thread_state();
404 thread->set_thread_state(_thread_in_vm);
405 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
406 ttyLocker ttyl;
407 BytecodeCounter::print();
408 }
409 // To see where a verify_oop failed, get $ebx+40/X for this frame.
410 // This is the value of eip which points to where verify_oop will return.
411 if (os::message_box(msg, "Execution stopped, print registers?")) {
412 print_state32(rdi, rsi, rbp, rsp, rbx, rdx, rcx, rax, eip);
413 BREAKPOINT;
414 }
415 } else {
416 ttyLocker ttyl;
417 ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n", msg);
418 }
419 // Don't assert holding the ttyLock
420 assert(false, err_msg("DEBUG MESSAGE: %s", msg));
421 ThreadStateTransition::transition(thread, _thread_in_vm, saved_state);
422 }
423
424 void MacroAssembler::print_state32(int rdi, int rsi, int rbp, int rsp, int rbx, int rdx, int rcx, int rax, int eip) {
425 ttyLocker ttyl;
426 FlagSetting fs(Debugging, true);
427 tty->print_cr("eip = 0x%08x", eip);
428 #ifndef PRODUCT
429 if ((WizardMode || Verbose) && PrintMiscellaneous) {
430 tty->cr();
431 findpc(eip);
432 tty->cr();
433 }
434 #endif
435 #define PRINT_REG(rax) \
436 { tty->print("%s = ", #rax); os::print_location(tty, rax); }
437 PRINT_REG(rax);
438 PRINT_REG(rbx);
439 PRINT_REG(rcx);
440 PRINT_REG(rdx);
866 thread->set_thread_state(_thread_in_vm);
867 #ifndef PRODUCT
868 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
869 ttyLocker ttyl;
870 BytecodeCounter::print();
871 }
872 #endif
873 // To see where a verify_oop failed, get $ebx+40/X for this frame.
874 // XXX correct this offset for amd64
875 // This is the value of eip which points to where verify_oop will return.
876 if (os::message_box(msg, "Execution stopped, print registers?")) {
877 print_state64(pc, regs);
878 BREAKPOINT;
879 assert(false, "start up GDB");
880 }
881 ThreadStateTransition::transition(thread, _thread_in_vm, saved_state);
882 } else {
883 ttyLocker ttyl;
884 ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n",
885 msg);
886 assert(false, err_msg("DEBUG MESSAGE: %s", msg));
887 }
888 }
889
890 void MacroAssembler::print_state64(int64_t pc, int64_t regs[]) {
891 ttyLocker ttyl;
892 FlagSetting fs(Debugging, true);
893 tty->print_cr("rip = 0x%016lx", pc);
894 #ifndef PRODUCT
895 tty->cr();
896 findpc(pc);
897 tty->cr();
898 #endif
899 #define PRINT_REG(rax, value) \
900 { tty->print("%s = ", #rax); os::print_location(tty, value); }
901 PRINT_REG(rax, regs[15]);
902 PRINT_REG(rbx, regs[12]);
903 PRINT_REG(rcx, regs[14]);
904 PRINT_REG(rdx, regs[13]);
905 PRINT_REG(rdi, regs[8]);
906 PRINT_REG(rsi, regs[9]);
|
400 thread->set_thread_state(_thread_in_vm);
401 if (ShowMessageBoxOnError) {
402 JavaThread* thread = JavaThread::current();
403 JavaThreadState saved_state = thread->thread_state();
404 thread->set_thread_state(_thread_in_vm);
405 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
406 ttyLocker ttyl;
407 BytecodeCounter::print();
408 }
409 // To see where a verify_oop failed, get $ebx+40/X for this frame.
410 // This is the value of eip which points to where verify_oop will return.
411 if (os::message_box(msg, "Execution stopped, print registers?")) {
412 print_state32(rdi, rsi, rbp, rsp, rbx, rdx, rcx, rax, eip);
413 BREAKPOINT;
414 }
415 } else {
416 ttyLocker ttyl;
417 ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n", msg);
418 }
419 // Don't assert holding the ttyLock
420 assert(false, "DEBUG MESSAGE: %s", msg);
421 ThreadStateTransition::transition(thread, _thread_in_vm, saved_state);
422 }
423
424 void MacroAssembler::print_state32(int rdi, int rsi, int rbp, int rsp, int rbx, int rdx, int rcx, int rax, int eip) {
425 ttyLocker ttyl;
426 FlagSetting fs(Debugging, true);
427 tty->print_cr("eip = 0x%08x", eip);
428 #ifndef PRODUCT
429 if ((WizardMode || Verbose) && PrintMiscellaneous) {
430 tty->cr();
431 findpc(eip);
432 tty->cr();
433 }
434 #endif
435 #define PRINT_REG(rax) \
436 { tty->print("%s = ", #rax); os::print_location(tty, rax); }
437 PRINT_REG(rax);
438 PRINT_REG(rbx);
439 PRINT_REG(rcx);
440 PRINT_REG(rdx);
866 thread->set_thread_state(_thread_in_vm);
867 #ifndef PRODUCT
868 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
869 ttyLocker ttyl;
870 BytecodeCounter::print();
871 }
872 #endif
873 // To see where a verify_oop failed, get $ebx+40/X for this frame.
874 // XXX correct this offset for amd64
875 // This is the value of eip which points to where verify_oop will return.
876 if (os::message_box(msg, "Execution stopped, print registers?")) {
877 print_state64(pc, regs);
878 BREAKPOINT;
879 assert(false, "start up GDB");
880 }
881 ThreadStateTransition::transition(thread, _thread_in_vm, saved_state);
882 } else {
883 ttyLocker ttyl;
884 ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n",
885 msg);
886 assert(false, "DEBUG MESSAGE: %s", msg);
887 }
888 }
889
890 void MacroAssembler::print_state64(int64_t pc, int64_t regs[]) {
891 ttyLocker ttyl;
892 FlagSetting fs(Debugging, true);
893 tty->print_cr("rip = 0x%016lx", pc);
894 #ifndef PRODUCT
895 tty->cr();
896 findpc(pc);
897 tty->cr();
898 #endif
899 #define PRINT_REG(rax, value) \
900 { tty->print("%s = ", #rax); os::print_location(tty, value); }
901 PRINT_REG(rax, regs[15]);
902 PRINT_REG(rbx, regs[12]);
903 PRINT_REG(rcx, regs[14]);
904 PRINT_REG(rdx, regs[13]);
905 PRINT_REG(rdi, regs[8]);
906 PRINT_REG(rsi, regs[9]);
|