hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
changeset 6176 4d9030fe341f
parent 5547 f4b087cbb361
child 7108 4f87b92f3060
equal deleted inserted replaced
6175:86dbf3cacacc 6176:4d9030fe341f
   716 void os::print_context(outputStream *st, void *context) {
   716 void os::print_context(outputStream *st, void *context) {
   717   if (context == NULL) return;
   717   if (context == NULL) return;
   718 
   718 
   719   ucontext_t *uc = (ucontext_t*)context;
   719   ucontext_t *uc = (ucontext_t*)context;
   720   st->print_cr("Registers:");
   720   st->print_cr("Registers:");
       
   721 
       
   722   // this is horrendously verbose but the layout of the registers in the
       
   723   // context does not match how we defined our abstract Register set, so
       
   724   // we can't just iterate through the gregs area
       
   725 
   721 #ifdef AMD64
   726 #ifdef AMD64
   722   st->print(  "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   727   st->print(  "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   723   st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
   728   st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
   724   st->print(", RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
   729   st->print(", RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
   725   st->print(", RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
   730   st->print(", RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
   743   st->print(", EFL=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
   748   st->print(", EFL=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
   744   st->print(", CSGSFS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_CSGSFS]);
   749   st->print(", CSGSFS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_CSGSFS]);
   745   st->print(", ERR=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ERR]);
   750   st->print(", ERR=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ERR]);
   746   st->cr();
   751   st->cr();
   747   st->print("  TRAPNO=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_TRAPNO]);
   752   st->print("  TRAPNO=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_TRAPNO]);
       
   753 
       
   754   st->cr();
       
   755   st->cr();
       
   756 
       
   757   st->print_cr("Register to memory mapping:");
       
   758   st->cr();
       
   759 
       
   760   // this is only for the "general purpose" registers
       
   761 
       
   762   st->print_cr("RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
       
   763   print_location(st, uc->uc_mcontext.gregs[REG_RAX]);
       
   764   st->cr();
       
   765   st->print_cr("RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
       
   766   print_location(st, uc->uc_mcontext.gregs[REG_RBX]);
       
   767   st->cr();
       
   768   st->print_cr("RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
       
   769   print_location(st, uc->uc_mcontext.gregs[REG_RCX]);
       
   770   st->cr();
       
   771   st->print_cr("RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
       
   772   print_location(st, uc->uc_mcontext.gregs[REG_RDX]);
       
   773   st->cr();
       
   774   st->print_cr("RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
       
   775   print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
       
   776   st->cr();
       
   777   st->print_cr("RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
       
   778   print_location(st, uc->uc_mcontext.gregs[REG_RBP]);
       
   779   st->cr();
       
   780   st->print_cr("RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
       
   781   print_location(st, uc->uc_mcontext.gregs[REG_RSI]);
       
   782   st->cr();
       
   783   st->print_cr("RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
       
   784   print_location(st, uc->uc_mcontext.gregs[REG_RDI]);
       
   785   st->cr();
       
   786   st->print_cr("R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]);
       
   787   print_location(st, uc->uc_mcontext.gregs[REG_R8]);
       
   788   st->cr();
       
   789   st->print_cr("R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]);
       
   790   print_location(st, uc->uc_mcontext.gregs[REG_R9]);
       
   791   st->cr();
       
   792   st->print_cr("R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]);
       
   793   print_location(st, uc->uc_mcontext.gregs[REG_R10]);
       
   794   st->cr();
       
   795   st->print_cr("R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]);
       
   796   print_location(st, uc->uc_mcontext.gregs[REG_R11]);
       
   797   st->cr();
       
   798   st->print_cr("R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]);
       
   799   print_location(st, uc->uc_mcontext.gregs[REG_R12]);
       
   800   st->cr();
       
   801   st->print_cr("R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]);
       
   802   print_location(st, uc->uc_mcontext.gregs[REG_R13]);
       
   803   st->cr();
       
   804   st->print_cr("R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
       
   805   print_location(st, uc->uc_mcontext.gregs[REG_R14]);
       
   806   st->cr();
       
   807   st->print_cr("R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
       
   808   print_location(st, uc->uc_mcontext.gregs[REG_R15]);
       
   809 
   748 #else
   810 #else
   749   st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
   811   st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
   750   st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
   812   st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
   751   st->print(", ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]);
   813   st->print(", ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]);
   752   st->print(", EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]);
   814   st->print(", EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]);
   757   st->print(", EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]);
   819   st->print(", EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]);
   758   st->cr();
   820   st->cr();
   759   st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]);
   821   st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]);
   760   st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2);
   822   st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2);
   761   st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
   823   st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
       
   824 
       
   825   st->cr();
       
   826   st->cr();
       
   827 
       
   828   st->print_cr("Register to memory mapping:");
       
   829   st->cr();
       
   830 
       
   831   // this is only for the "general purpose" registers
       
   832 
       
   833   st->print_cr("EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
       
   834   print_location(st, uc->uc_mcontext.gregs[REG_EAX]);
       
   835   st->cr();
       
   836   st->print_cr("EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
       
   837   print_location(st, uc->uc_mcontext.gregs[REG_EBX]);
       
   838   st->cr();
       
   839   st->print_cr("ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]);
       
   840   print_location(st, uc->uc_mcontext.gregs[REG_ECX]);
       
   841   st->cr();
       
   842   st->print_cr("EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]);
       
   843   print_location(st, uc->uc_mcontext.gregs[REG_EDX]);
       
   844   st->cr();
       
   845   st->print_cr("ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESP]);
       
   846   print_location(st, uc->uc_mcontext.gregs[REG_ESP]);
       
   847   st->cr();
       
   848   st->print_cr("EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBP]);
       
   849   print_location(st, uc->uc_mcontext.gregs[REG_EBP]);
       
   850   st->cr();
       
   851   st->print_cr("ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESI]);
       
   852   print_location(st, uc->uc_mcontext.gregs[REG_ESI]);
       
   853   st->cr();
       
   854   st->print_cr("EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]);
       
   855   print_location(st, uc->uc_mcontext.gregs[REG_EDI]);
       
   856 
   762 #endif // AMD64
   857 #endif // AMD64
   763   st->cr();
   858   st->cr();
   764   st->cr();
   859   st->cr();
   765 
   860 
   766   intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
   861   intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);