< prev index next >

src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp

Print this page
rev 51015 : 8207342: error occurred during error reporting (printing register info)
Summary: os::print_location misses a check if the pointer is readable.
Reviewed-by:


 586   print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t));
 587   st->cr();
 588 
 589   // Note: it may be unsafe to inspect memory near pc. For example, pc may
 590   // point to garbage if entry point in an nmethod is corrupted. Leave
 591   // this at the end, and hope for the best.
 592   address pc = os::Linux::ucontext_get_pc(uc);
 593   st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
 594   print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
 595   st->cr();
 596 }
 597 
 598 void os::print_register_info(outputStream *st, const void *context) {
 599   if (context == NULL) return;
 600 
 601   const ucontext_t *uc = (const ucontext_t*)context;
 602 
 603   st->print_cr("Register to memory mapping:");
 604   st->cr();
 605 
 606   // this is only for the "general purpose" registers


 607   for (int i = 0; i < 32; i++) {
 608     st->print("r%-2d=", i);
 609     print_location(st, uc->uc_mcontext.regs->gpr[i]);
 610   }
 611   st->cr();
 612 }
 613 
 614 extern "C" {
 615   int SpinPause() {
 616     return 0;
 617   }
 618 }
 619 
 620 #ifndef PRODUCT
 621 void os::verify_stack_alignment() {
 622   assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
 623 }
 624 #endif
 625 
 626 int os::extra_bang_size_in_bytes() {


 586   print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t));
 587   st->cr();
 588 
 589   // Note: it may be unsafe to inspect memory near pc. For example, pc may
 590   // point to garbage if entry point in an nmethod is corrupted. Leave
 591   // this at the end, and hope for the best.
 592   address pc = os::Linux::ucontext_get_pc(uc);
 593   st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
 594   print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
 595   st->cr();
 596 }
 597 
 598 void os::print_register_info(outputStream *st, const void *context) {
 599   if (context == NULL) return;
 600 
 601   const ucontext_t *uc = (const ucontext_t*)context;
 602 
 603   st->print_cr("Register to memory mapping:");
 604   st->cr();
 605 
 606   st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip);
 607   st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link);
 608   st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->ctr);
 609   for (int i = 0; i < 32; i++) {
 610     st->print("r%-2d=", i);
 611     print_location(st, uc->uc_mcontext.regs->gpr[i]);
 612   }
 613   st->cr();
 614 }
 615 
 616 extern "C" {
 617   int SpinPause() {
 618     return 0;
 619   }
 620 }
 621 
 622 #ifndef PRODUCT
 623 void os::verify_stack_alignment() {
 624   assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
 625 }
 626 #endif
 627 
 628 int os::extra_bang_size_in_bytes() {
< prev index next >