increase in object code size
Richard Henderson
rth@cygnus.com
Tue Sep 23 22:08:00 GMT 1997
> Not gon' happen, or not everywhere anyway. On the x86, SEGV screws up the
> stack. How do you unwind a signal handler?
On OSF/1 they do it by making the process context used by the
exception code the same as struct sigcontext that is passed into
the signal handler. Thus you do
int sighandler(int sig, siginfo_t *info, void *_c)
{
ucontext_t *context = (ucontext_t *)_c;
exc_raise_signal_exception(myexcptnr, mycode, &context->uc_mcontext);
}
So you actually start the unwind in the context the signal happened
in. It is pretty spiff, really. I'm of the opinion that we should
open up the internals of our exception handling in similar ways.
As for the lossage with try malloc catch free, well those are the
breaks. But there are other ways to use signals and exceptions that
are useful. Admittedly SEGV ans FPE are the best examples...
r~
More information about the Gcc
mailing list