Mail Archives: djgpp/1999/02/14/04:56:38
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
>
- Raw text -