This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: increase in object code size


> 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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]