ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/sigsegv.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/sigsegv.cpp (file contents):
Revision 1.11 by gbeauche, 2002-05-12T13:51:22Z vs.
Revision 1.12 by gbeauche, 2002-05-16T15:48:06Z

# Line 44 | Line 44 | typedef RETSIGTYPE (*signal_handler)(int
44   static bool sigsegv_ignore_fault = false;
45  
46   // User's SIGSEGV handler
47 < static sigsegv_handler_t sigsegv_user_handler = 0;
47 > static sigsegv_fault_handler_t sigsegv_fault_handler = 0;
48  
49   // Function called to dump state if we can't handle the fault
50 < static sigsegv_handler_t sigsegv_dump_state = 0;
50 > static sigsegv_state_dumper_t sigsegv_state_dumper = 0;
51  
52   // Actual SIGSEGV handler installer
53   static bool sigsegv_do_install_handler(int sig);
# Line 488 | Line 488 | static void sigsegv_handler(SIGSEGV_FAUL
488          bool fault_recovered = false;
489          
490          // Call user's handler and reinstall the global handler, if required
491 <        if (sigsegv_user_handler(fault_address, fault_instruction)) {
491 >        if (sigsegv_fault_handler(fault_address, fault_instruction)) {
492   #if (defined(HAVE_SIGACTION) ? defined(SIGACTION_NEED_REINSTALL) : defined(SIGNAL_NEED_REINSTALL))
493                  sigsegv_do_install_handler(sig);
494   #endif
# Line 509 | Line 509 | static void sigsegv_handler(SIGSEGV_FAUL
509   #undef FAULT_HANDLER
510                  
511                  // We can't do anything with the fault_address, dump state?
512 <                if (sigsegv_dump_state != 0)
513 <                        sigsegv_dump_state(fault_address, fault_instruction);
512 >                if (sigsegv_state_dumper != 0)
513 >                        sigsegv_state_dumper(fault_address, fault_instruction);
514          }
515   }
516   #endif
# Line 557 | Line 557 | static bool sigsegv_do_install_handler(i
557   }
558   #endif
559  
560 < bool sigsegv_install_handler(sigsegv_handler_t handler)
560 > bool sigsegv_install_handler(sigsegv_fault_handler_t handler)
561   {
562   #ifdef HAVE_SIGSEGV_RECOVERY
563 <        sigsegv_user_handler = handler;
563 >        sigsegv_fault_handler = handler;
564          bool success = true;
565   #define FAULT_HANDLER(sig) success = success && sigsegv_do_install_handler(sig);
566          SIGSEGV_ALL_SIGNALS
# Line 580 | Line 580 | bool sigsegv_install_handler(sigsegv_han
580   void sigsegv_deinstall_handler(void)
581   {
582   #ifdef HAVE_SIGSEGV_RECOVERY
583 <        sigsegv_user_handler = 0;
583 >        sigsegv_fault_handler = 0;
584   #define FAULT_HANDLER(sig) signal(sig, SIG_DFL);
585          SIGSEGV_ALL_SIGNALS
586   #undef FAULT_HANDLER
# Line 602 | Line 602 | void sigsegv_set_ignore_state(bool ignor
602   *  Set callback function when we cannot handle the fault
603   */
604  
605 < void sigsegv_set_dump_state(sigsegv_handler_t handler)
605 > void sigsegv_set_dump_state(sigsegv_state_dumper_t handler)
606   {
607 <        sigsegv_dump_state = handler;
607 >        sigsegv_state_dumper = handler;
608   }
609  
610  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines