Re: handling exceptions

Gautier <>
29 Oct 1999 02:34:24 -0400

          From comp.compilers

Related articles
handling exceptions (Maikel Pennings) (1999-10-27)
Re: handling exceptions (1999-10-28)
Re: handling exceptions (Christian Stapfer) (1999-10-28)
Re: handling exceptions (1999-10-29)
Re: handling exceptions (Gautier) (1999-10-29)
Re: handling exceptions (Laurent Guerby) (1999-10-29)
Re: handling exceptions (Ehud Lamm) (1999-10-31)
| List of all articles for this month |

From: Gautier <>
Newsgroups: comp.compilers
Date: 29 Oct 1999 02:34:24 -0400
Organization: Compilers Central
References: 99-10-127
Keywords: errors

> 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

Download the GNAT compiler and compile sources with `gcc -S xxxx.adb'
you'll see how it is done. IIRC, GNAT has a zero-cost exception
handler that calls some `raise_exception' procedure that manages the
cascading in exception parts. Since the full source of GNAT run-time
library is available, you'll find what you're looking for. The
exception mechanism is surely well documented. You can also trace with
a step-by-step debugger.

For a quick look on exceptions, you can browse through the sources
of Unzip-Ada
which uses much the exception mechanism. It saves lot of
instructions for transporting error codes as in C or Pascal.
Some links at bottom...

A question to news:comp.lang.ada can help too (e.g. how do
other compilers do).


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.