690 }
691 }
692
693 if (pc == NULL && uc != NULL) {
694 pc = (address) uc->uc_mcontext.gregs[REG_PC];
695 }
696
697 // unmask current signal
698 sigset_t newset;
699 sigemptyset(&newset);
700 sigaddset(&newset, sig);
701 sigprocmask(SIG_UNBLOCK, &newset, NULL);
702
703 // Determine which sort of error to throw. Out of swap may signal
704 // on the thread stack, which could get a mapping error when touched.
705 address addr = (address) info->si_addr;
706 if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) {
707 vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack.");
708 }
709
710 VMError err(t, sig, pc, info, ucVoid);
711 err.report_and_die();
712
713 ShouldNotReachHere();
714 return false;
715 }
716
717 void os::print_context(outputStream *st, void *context) {
718 if (context == NULL) return;
719
720 ucontext_t *uc = (ucontext_t*)context;
721 st->print_cr("Registers:");
722 #ifdef AMD64
723 st->print( "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
724 st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
725 st->print(", RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
726 st->print(", RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
727 st->cr();
728 st->print( "RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
729 st->print(", RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
730 st->print(", RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
731 st->print(", RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
|
690 }
691 }
692
693 if (pc == NULL && uc != NULL) {
694 pc = (address) uc->uc_mcontext.gregs[REG_PC];
695 }
696
697 // unmask current signal
698 sigset_t newset;
699 sigemptyset(&newset);
700 sigaddset(&newset, sig);
701 sigprocmask(SIG_UNBLOCK, &newset, NULL);
702
703 // Determine which sort of error to throw. Out of swap may signal
704 // on the thread stack, which could get a mapping error when touched.
705 address addr = (address) info->si_addr;
706 if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) {
707 vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack.");
708 }
709
710 VMError::report_and_die(t, sig, pc, info, ucVoid);
711
712 ShouldNotReachHere();
713 return false;
714 }
715
716 void os::print_context(outputStream *st, void *context) {
717 if (context == NULL) return;
718
719 ucontext_t *uc = (ucontext_t*)context;
720 st->print_cr("Registers:");
721 #ifdef AMD64
722 st->print( "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
723 st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
724 st->print(", RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
725 st->print(", RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
726 st->cr();
727 st->print( "RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
728 st->print(", RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
729 st->print(", RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
730 st->print(", RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
|