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]
Other format: [Raw text]

Re: __attribute__((cleanup(function)) versus try/finally


> > > The __finally block is executed in case of both "normal" C++ exceptions
> > > as well as "faults" such as accessing a NULL pointer, dividing by zero,
> > > etc.
> >
> >And your point is... ? Libjava does this for dwarf2 EH on Linux.
>
> Yes, I know (http://gcc.gnu.org/java/port-signals.html).


Oh no, that page is way, way out of date.  I must rewrite it.
There's not even any mention of MD_FALLBACK_FRAME_STATE_FOR, which is
the crucial part of the job.

Maybe laymen aren't supposed to be implementing MAKE_THROW_FRAME for
libgcj ;-), but I think it should at least be pointed out that the crucial reasons
the given example works *at all* are that:


1. Linux does not care if the signal handler returns or not (unlike Windows).

2. A proper MD_FALLBACK_FRAME_STATE_FOR definition for Linux/x86 ensures
  that unwinding works through the intervening signal handler frame when a
  "throw" occurs, instead of aborting the process with an uncerimonious
  "abnormal program termination" as would have happened otherwise.

Ranjit.

_________________________________________________________________
Want to get married? Try online matrimony. http://server1.msn.co.in/features/onlinematrimony/index.asp It's cool.



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