Date: Sun, 14 Feb 1999 10:53:00 +0100 (MET) From: Gisle Vanem To: Nate Eldredge cc: djgpp AT delorie DOT com Subject: Re: Exception handling In-Reply-To: <36C657F1.50F398A8@cartsys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Sat, 13 Feb 1999, Nate Eldredge wrote: > But under DJGPP, this looks more difficult. I don't think a signal > handler can get the crashing registers. How about saving the '__djgpp_exception_state_ptr' into your own jmp_buf ? > And if it returns the library > code explicitly aborts. (Is this done for a reason, or just because > most signal handlers that return haven't actually fixed the problem?) This is from an exception-handler I once made: static void ExcHandler (int sig) { static int been_here = 0; static jmp_buf exc_buf; int i; if (been_here) { been_here = 0; signal (sig,SIG_DFL); __djgpp_exception_state_ptr = &exc_buf; } else { memcpy (&exc_buf,__djgpp_exception_state_ptr,sizeof(exc_buf)); been_here = 1; if (sig == SIGFPE) { _clear87(); _fpreset(); } psignal (sig, "shutdown"); .. do your main exc-processing here.. } raise (SIGABRT); } Maybe you could do 'signal(sig,SIG_IGN)' instead of raising SIGABRT ? Gisle V. > > Nate Eldredge > nate AT cartsys DOT com >