< prev index next >

src/os_cpu/linux_x86/vm/os_linux_x86.cpp

Print this page
rev 10979 : 8140594: Various minor code improvements (compiler)


 806 #else
 807   st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
 808   st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
 809   st->print(", ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]);
 810   st->print(", EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]);
 811   st->cr();
 812   st->print(  "ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_UESP]);
 813   st->print(", EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBP]);
 814   st->print(", ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESI]);
 815   st->print(", EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]);
 816   st->cr();
 817   st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]);
 818   st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
 819   st->print(", CR2=" PTR64_FORMAT, (uint64_t)uc->uc_mcontext.cr2);
 820 #endif // AMD64
 821   st->cr();
 822   st->cr();
 823 
 824   intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
 825   st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
 826   print_hex_dump(st, (address)sp, (address)(sp + 8*sizeof(intptr_t)), sizeof(intptr_t));
 827   st->cr();
 828 
 829   // Note: it may be unsafe to inspect memory near pc. For example, pc may
 830   // point to garbage if entry point in an nmethod is corrupted. Leave
 831   // this at the end, and hope for the best.
 832   address pc = os::Linux::ucontext_get_pc(uc);
 833   st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
 834   print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
 835 }
 836 
 837 void os::print_register_info(outputStream *st, const void *context) {
 838   if (context == NULL) return;
 839 
 840   const ucontext_t *uc = (const ucontext_t*)context;
 841 
 842   st->print_cr("Register to memory mapping:");
 843   st->cr();
 844 
 845   // this is horrendously verbose but the layout of the registers in the
 846   // context does not match how we defined our abstract Register set, so




 806 #else
 807   st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
 808   st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
 809   st->print(", ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]);
 810   st->print(", EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]);
 811   st->cr();
 812   st->print(  "ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_UESP]);
 813   st->print(", EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBP]);
 814   st->print(", ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESI]);
 815   st->print(", EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]);
 816   st->cr();
 817   st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]);
 818   st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
 819   st->print(", CR2=" PTR64_FORMAT, (uint64_t)uc->uc_mcontext.cr2);
 820 #endif // AMD64
 821   st->cr();
 822   st->cr();
 823 
 824   intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
 825   st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
 826   print_hex_dump(st, (address)sp, (address)(sp + 8), sizeof(intptr_t));
 827   st->cr();
 828 
 829   // Note: it may be unsafe to inspect memory near pc. For example, pc may
 830   // point to garbage if entry point in an nmethod is corrupted. Leave
 831   // this at the end, and hope for the best.
 832   address pc = os::Linux::ucontext_get_pc(uc);
 833   st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
 834   print_hex_dump(st, pc - 32, pc + 32, sizeof(char));
 835 }
 836 
 837 void os::print_register_info(outputStream *st, const void *context) {
 838   if (context == NULL) return;
 839 
 840   const ucontext_t *uc = (const ucontext_t*)context;
 841 
 842   st->print_cr("Register to memory mapping:");
 843   st->cr();
 844 
 845   // this is horrendously verbose but the layout of the registers in the
 846   // context does not match how we defined our abstract Register set, so


< prev index next >