< prev index next >

src/cpu/x86/vm/macroAssembler_x86.cpp

Print this page




 877     // To see where a verify_oop failed, get $ebx+40/X for this frame.
 878     // XXX correct this offset for amd64
 879     // This is the value of eip which points to where verify_oop will return.
 880     if (os::message_box(msg, "Execution stopped, print registers?")) {
 881       print_state64(pc, regs);
 882       BREAKPOINT;
 883       assert(false, "start up GDB");
 884     }
 885     ThreadStateTransition::transition(thread, _thread_in_vm, saved_state);
 886   } else {
 887     ttyLocker ttyl;
 888     ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n",
 889                     msg);
 890     assert(false, "DEBUG MESSAGE: %s", msg);
 891   }
 892 }
 893 
 894 void MacroAssembler::print_state64(int64_t pc, int64_t regs[]) {
 895   ttyLocker ttyl;
 896   FlagSetting fs(Debugging, true);
 897   tty->print_cr("rip = 0x%016lx", pc);
 898 #ifndef PRODUCT
 899   tty->cr();
 900   findpc(pc);
 901   tty->cr();
 902 #endif
 903 #define PRINT_REG(rax, value) \
 904   { tty->print("%s = ", #rax); os::print_location(tty, value); }
 905   PRINT_REG(rax, regs[15]);
 906   PRINT_REG(rbx, regs[12]);
 907   PRINT_REG(rcx, regs[14]);
 908   PRINT_REG(rdx, regs[13]);
 909   PRINT_REG(rdi, regs[8]);
 910   PRINT_REG(rsi, regs[9]);
 911   PRINT_REG(rbp, regs[10]);
 912   PRINT_REG(rsp, regs[11]);
 913   PRINT_REG(r8 , regs[7]);
 914   PRINT_REG(r9 , regs[6]);
 915   PRINT_REG(r10, regs[5]);
 916   PRINT_REG(r11, regs[4]);
 917   PRINT_REG(r12, regs[3]);
 918   PRINT_REG(r13, regs[2]);
 919   PRINT_REG(r14, regs[1]);
 920   PRINT_REG(r15, regs[0]);
 921 #undef PRINT_REG
 922   // Print some words near top of staack.
 923   int64_t* rsp = (int64_t*) regs[11];
 924   int64_t* dump_sp = rsp;
 925   for (int col1 = 0; col1 < 8; col1++) {
 926     tty->print("(rsp+0x%03x) 0x%016lx: ", (int)((intptr_t)dump_sp - (intptr_t)rsp), (int64_t)dump_sp);
 927     os::print_location(tty, *dump_sp++);
 928   }
 929   for (int row = 0; row < 25; row++) {
 930     tty->print("(rsp+0x%03x) 0x%016lx: ", (int)((intptr_t)dump_sp - (intptr_t)rsp), (int64_t)dump_sp);
 931     for (int col = 0; col < 4; col++) {
 932       tty->print(" 0x%016lx", *dump_sp++);
 933     }
 934     tty->cr();
 935   }
 936   // Print some instructions around pc:
 937   Disassembler::decode((address)pc-64, (address)pc);
 938   tty->print_cr("--------");
 939   Disassembler::decode((address)pc, (address)pc+32);
 940 }
 941 
 942 #endif // _LP64
 943 
 944 // Now versions that are common to 32/64 bit
 945 
 946 void MacroAssembler::addptr(Register dst, int32_t imm32) {
 947   LP64_ONLY(addq(dst, imm32)) NOT_LP64(addl(dst, imm32));
 948 }
 949 
 950 void MacroAssembler::addptr(Register dst, Register src) {
 951   LP64_ONLY(addq(dst, src)) NOT_LP64(addl(dst, src));
 952 }




 877     // To see where a verify_oop failed, get $ebx+40/X for this frame.
 878     // XXX correct this offset for amd64
 879     // This is the value of eip which points to where verify_oop will return.
 880     if (os::message_box(msg, "Execution stopped, print registers?")) {
 881       print_state64(pc, regs);
 882       BREAKPOINT;
 883       assert(false, "start up GDB");
 884     }
 885     ThreadStateTransition::transition(thread, _thread_in_vm, saved_state);
 886   } else {
 887     ttyLocker ttyl;
 888     ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n",
 889                     msg);
 890     assert(false, "DEBUG MESSAGE: %s", msg);
 891   }
 892 }
 893 
 894 void MacroAssembler::print_state64(int64_t pc, int64_t regs[]) {
 895   ttyLocker ttyl;
 896   FlagSetting fs(Debugging, true);
 897   tty->print_cr("rip = 0x%016lx", (intptr_t)pc);
 898 #ifndef PRODUCT
 899   tty->cr();
 900   findpc(pc);
 901   tty->cr();
 902 #endif
 903 #define PRINT_REG(rax, value) \
 904   { tty->print("%s = ", #rax); os::print_location(tty, value); }
 905   PRINT_REG(rax, regs[15]);
 906   PRINT_REG(rbx, regs[12]);
 907   PRINT_REG(rcx, regs[14]);
 908   PRINT_REG(rdx, regs[13]);
 909   PRINT_REG(rdi, regs[8]);
 910   PRINT_REG(rsi, regs[9]);
 911   PRINT_REG(rbp, regs[10]);
 912   PRINT_REG(rsp, regs[11]);
 913   PRINT_REG(r8 , regs[7]);
 914   PRINT_REG(r9 , regs[6]);
 915   PRINT_REG(r10, regs[5]);
 916   PRINT_REG(r11, regs[4]);
 917   PRINT_REG(r12, regs[3]);
 918   PRINT_REG(r13, regs[2]);
 919   PRINT_REG(r14, regs[1]);
 920   PRINT_REG(r15, regs[0]);
 921 #undef PRINT_REG
 922   // Print some words near top of staack.
 923   int64_t* rsp = (int64_t*) regs[11];
 924   int64_t* dump_sp = rsp;
 925   for (int col1 = 0; col1 < 8; col1++) {
 926     tty->print("(rsp+0x%03x) 0x%016lx: ", (int)((intptr_t)dump_sp - (intptr_t)rsp), (intptr_t)dump_sp);
 927     os::print_location(tty, *dump_sp++);
 928   }
 929   for (int row = 0; row < 25; row++) {
 930     tty->print("(rsp+0x%03x) 0x%016lx: ", (int)((intptr_t)dump_sp - (intptr_t)rsp), (intptr_t)dump_sp);
 931     for (int col = 0; col < 4; col++) {
 932       tty->print(" 0x%016lx", (intptr_t)*dump_sp++);
 933     }
 934     tty->cr();
 935   }
 936   // Print some instructions around pc:
 937   Disassembler::decode((address)pc-64, (address)pc);
 938   tty->print_cr("--------");
 939   Disassembler::decode((address)pc, (address)pc+32);
 940 }
 941 
 942 #endif // _LP64
 943 
 944 // Now versions that are common to 32/64 bit
 945 
 946 void MacroAssembler::addptr(Register dst, int32_t imm32) {
 947   LP64_ONLY(addq(dst, imm32)) NOT_LP64(addl(dst, imm32));
 948 }
 949 
 950 void MacroAssembler::addptr(Register dst, Register src) {
 951   LP64_ONLY(addq(dst, src)) NOT_LP64(addl(dst, src));
 952 }


< prev index next >