hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
changeset 6176 4d9030fe341f
parent 5904 51e9775a3095
child 7108 4f87b92f3060
equal deleted inserted replaced
6175:86dbf3cacacc 6176:4d9030fe341f
   717 void os::print_context(outputStream *st, void *context) {
   717 void os::print_context(outputStream *st, void *context) {
   718   if (context == NULL) return;
   718   if (context == NULL) return;
   719 
   719 
   720   ucontext_t *uc = (ucontext_t*)context;
   720   ucontext_t *uc = (ucontext_t*)context;
   721   st->print_cr("Registers:");
   721   st->print_cr("Registers:");
       
   722 
       
   723   // this is horrendously verbose but the layout of the registers in the
       
   724   // context does not match how we defined our abstract Register set, so
       
   725   // we can't just iterate through the gregs area
       
   726 
   722 #ifdef AMD64
   727 #ifdef AMD64
   723   st->print(  "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   728   st->print(  "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   724   st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
   729   st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
   725   st->print(", RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
   730   st->print(", RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
   726   st->print(", RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
   731   st->print(", RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
   740   st->print(", R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
   745   st->print(", R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
   741   st->print(", R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
   746   st->print(", R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
   742   st->cr();
   747   st->cr();
   743   st->print(  "RIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RIP]);
   748   st->print(  "RIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RIP]);
   744   st->print(", RFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RFL]);
   749   st->print(", RFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RFL]);
       
   750 
       
   751   st->cr();
       
   752   st->cr();
       
   753 
       
   754   st->print_cr("Register to memory mapping:");
       
   755   st->cr();
       
   756 
       
   757   // this is only for the "general purpose" registers
       
   758 
       
   759   st->print_cr("RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
       
   760   print_location(st, uc->uc_mcontext.gregs[REG_RAX]);
       
   761   st->cr();
       
   762   st->print_cr("RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
       
   763   print_location(st, uc->uc_mcontext.gregs[REG_RBX]);
       
   764   st->cr();
       
   765   st->print_cr("RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
       
   766   print_location(st, uc->uc_mcontext.gregs[REG_RCX]);
       
   767   st->cr();
       
   768   st->print_cr("RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
       
   769   print_location(st, uc->uc_mcontext.gregs[REG_RDX]);
       
   770   st->cr();
       
   771   st->print_cr("RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
       
   772   print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
       
   773   st->cr();
       
   774   st->print_cr("RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
       
   775   print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
       
   776   st->cr();
       
   777   st->print_cr("RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
       
   778   print_location(st, uc->uc_mcontext.gregs[REG_RSI]);
       
   779   st->cr();
       
   780   st->print_cr("RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
       
   781   print_location(st, uc->uc_mcontext.gregs[REG_RDI]);
       
   782   st->cr();
       
   783   st->print_cr("R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]);
       
   784   print_location(st, uc->uc_mcontext.gregs[REG_R8]);
       
   785   st->cr();
       
   786   st->print_cr("R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]);
       
   787   print_location(st, uc->uc_mcontext.gregs[REG_R9]);
       
   788   st->cr();
       
   789   st->print_cr("R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]);
       
   790   print_location(st, uc->uc_mcontext.gregs[REG_R10]);
       
   791   st->cr();
       
   792   st->print_cr("R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]);
       
   793   print_location(st, uc->uc_mcontext.gregs[REG_R11]);
       
   794   st->cr();
       
   795   st->print_cr("R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]);
       
   796   print_location(st, uc->uc_mcontext.gregs[REG_R12]);
       
   797   st->cr();
       
   798   st->print_cr("R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]);
       
   799   print_location(st, uc->uc_mcontext.gregs[REG_R13]);
       
   800   st->cr();
       
   801   st->print_cr("R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
       
   802   print_location(st, uc->uc_mcontext.gregs[REG_R14]);
       
   803   st->cr();
       
   804   st->print_cr("R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
       
   805   print_location(st, uc->uc_mcontext.gregs[REG_R15]);
       
   806 
   745 #else
   807 #else
   746   st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]);
   808   st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]);
   747   st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]);
   809   st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]);
   748   st->print(", ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ECX]);
   810   st->print(", ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ECX]);
   749   st->print(", EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDX]);
   811   st->print(", EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDX]);
   753   st->print(", ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ESI]);
   815   st->print(", ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ESI]);
   754   st->print(", EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDI]);
   816   st->print(", EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDI]);
   755   st->cr();
   817   st->cr();
   756   st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EIP]);
   818   st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EIP]);
   757   st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EFL]);
   819   st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EFL]);
       
   820 
       
   821   st->cr();
       
   822   st->cr();
       
   823 
       
   824   st->print_cr("Register to memory mapping:");
       
   825   st->cr();
       
   826 
       
   827   // this is only for the "general purpose" registers
       
   828 
       
   829   st->print_cr("EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]);
       
   830   print_location(st, uc->uc_mcontext.gregs[EAX]);
       
   831   st->cr();
       
   832   st->print_cr("EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]);
       
   833   print_location(st, uc->uc_mcontext.gregs[EBX]);
       
   834   st->cr();
       
   835   st->print_cr("ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ECX]);
       
   836   print_location(st, uc->uc_mcontext.gregs[ECX]);
       
   837   st->cr();
       
   838   st->print_cr("EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDX]);
       
   839   print_location(st, uc->uc_mcontext.gregs[EDX]);
       
   840   st->cr();
       
   841   st->print_cr("ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[UESP]);
       
   842   print_location(st, uc->uc_mcontext.gregs[UESP]);
       
   843   st->cr();
       
   844   st->print_cr("EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBP]);
       
   845   print_location(st, uc->uc_mcontext.gregs[EBP]);
       
   846   st->cr();
       
   847   st->print_cr("ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ESI]);
       
   848   print_location(st, uc->uc_mcontext.gregs[ESI]);
       
   849   st->cr();
       
   850   st->print_cr("EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDI]);
       
   851   print_location(st, uc->uc_mcontext.gregs[EDI]);
       
   852 
   758 #endif // AMD64
   853 #endif // AMD64
   759   st->cr();
   854   st->cr();
   760   st->cr();
   855   st->cr();
   761 
   856 
   762   intptr_t *sp = (intptr_t *)os::Solaris::ucontext_get_sp(uc);
   857   intptr_t *sp = (intptr_t *)os::Solaris::ucontext_get_sp(uc);
   771   address pc = epc.pc();
   866   address pc = epc.pc();
   772   st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
   867   st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
   773   print_hex_dump(st, pc - 16, pc + 16, sizeof(char));
   868   print_hex_dump(st, pc - 16, pc + 16, sizeof(char));
   774 }
   869 }
   775 
   870 
       
   871 
   776 #ifdef AMD64
   872 #ifdef AMD64
   777 void os::Solaris::init_thread_fpu_state(void) {
   873 void os::Solaris::init_thread_fpu_state(void) {
   778   // Nothing to do
   874   // Nothing to do
   779 }
   875 }
   780 #else
   876 #else