|handling exceptions firstname.lastname@example.org (Maikel Pennings) (1999-10-27)|
|Re: handling exceptions email@example.com (1999-10-28)|
|Re: handling exceptions firstname.lastname@example.org (Christian Stapfer) (1999-10-28)|
|Re: handling exceptions email@example.com (1999-10-29)|
|Re: handling exceptions Gautier.deMontmollin@maths.unine.ch (Gautier) (1999-10-29)|
|Re: handling exceptions firstname.lastname@example.org (Laurent Guerby) (1999-10-29)|
|Re: handling exceptions email@example.com (Ehud Lamm) (1999-10-31)|
|From:||Laurent Guerby <firstname.lastname@example.org>|
|Date:||29 Oct 1999 02:36:03 -0400|
Maikel Pennings <email@example.com> writes:
> Does anyone know how a compiler (e.g. ada95 compiler) handles
> exceptions. I have to add exception handling to a compiler for a
> project, and I'm wondering how this is done in real compilers
Well you can always grab the latest source release of the GNAT, the
GNU Ada 95 compiler and look at the comments (the exception stuff is
heavily commented both in the front-end and in the run-time).
Right now, AFAIK, GNAT offers two mechanisms for handling exceptions,
one based on setjmp/longjmp, which is very portable but induces
run-time overhead when entering scopes with exception handlers, and a
new one, the so-called "zero-cost exception scheme", which has no
run-time overhead when entering scopes with exception handlers and use
code-tables to know what to do when an exception is raised, and
usually needs some platform specific code (it is nicely abstracted
though, see the code for the Ada.Exceptions package).
If you want to study high-level to low-level code transformation, GNAT
is very interesting since it has a flag (-gnatdg) that shows the
"low-level" Ada code when the front-end expander has done its job, so
you can see how "high-level" constructs are broken down into run-time
calls. (One of the latest gizmo with 3.12 is that you can set a flag
to be able to debug into the generated low-level Ada code instead of
the original programmer-written one ;-).
If you want more help, you can subscribe to the GNAT chat mailing-list
and ask questions there, GNAT knowledgeable people are looking there.
<http://www.gnat.com> for subscription information.
Return to the
Search the comp.compilers archives again.