574
575 if (pc == NULL && uc != NULL) {
576 pc = (address) uc->uc_mcontext.gregs[REG_PC];
577 }
578
579 // Sometimes the register windows are not properly flushed.
580 if(uc->uc_mcontext.gwins != NULL) {
581 ::handle_unflushed_register_windows(uc->uc_mcontext.gwins);
582 }
583
584 // unmask current signal
585 sigset_t newset;
586 sigemptyset(&newset);
587 sigaddset(&newset, sig);
588 sigprocmask(SIG_UNBLOCK, &newset, NULL);
589
590 // Determine which sort of error to throw. Out of swap may signal
591 // on the thread stack, which could get a mapping error when touched.
592 address addr = (address) info->si_addr;
593 if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) {
594 vm_exit_out_of_memory(0, "Out of swap space to map in thread stack.");
595 }
596
597 VMError err(t, sig, pc, info, ucVoid);
598 err.report_and_die();
599
600 ShouldNotReachHere();
601 }
602
603 void os::print_context(outputStream *st, void *context) {
604 if (context == NULL) return;
605
606 ucontext_t *uc = (ucontext_t*)context;
607 st->print_cr("Registers:");
608
609 st->print_cr(" G1=" INTPTR_FORMAT " G2=" INTPTR_FORMAT
610 " G3=" INTPTR_FORMAT " G4=" INTPTR_FORMAT,
611 uc->uc_mcontext.gregs[REG_G1],
612 uc->uc_mcontext.gregs[REG_G2],
613 uc->uc_mcontext.gregs[REG_G3],
614 uc->uc_mcontext.gregs[REG_G4]);
|
574
575 if (pc == NULL && uc != NULL) {
576 pc = (address) uc->uc_mcontext.gregs[REG_PC];
577 }
578
579 // Sometimes the register windows are not properly flushed.
580 if(uc->uc_mcontext.gwins != NULL) {
581 ::handle_unflushed_register_windows(uc->uc_mcontext.gwins);
582 }
583
584 // unmask current signal
585 sigset_t newset;
586 sigemptyset(&newset);
587 sigaddset(&newset, sig);
588 sigprocmask(SIG_UNBLOCK, &newset, NULL);
589
590 // Determine which sort of error to throw. Out of swap may signal
591 // on the thread stack, which could get a mapping error when touched.
592 address addr = (address) info->si_addr;
593 if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) {
594 vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack.");
595 }
596
597 VMError err(t, sig, pc, info, ucVoid);
598 err.report_and_die();
599
600 ShouldNotReachHere();
601 }
602
603 void os::print_context(outputStream *st, void *context) {
604 if (context == NULL) return;
605
606 ucontext_t *uc = (ucontext_t*)context;
607 st->print_cr("Registers:");
608
609 st->print_cr(" G1=" INTPTR_FORMAT " G2=" INTPTR_FORMAT
610 " G3=" INTPTR_FORMAT " G4=" INTPTR_FORMAT,
611 uc->uc_mcontext.gregs[REG_G1],
612 uc->uc_mcontext.gregs[REG_G2],
613 uc->uc_mcontext.gregs[REG_G3],
614 uc->uc_mcontext.gregs[REG_G4]);
|