Related articles |
---|
handling exceptions m.w.m.pennings@twi.tudelft.nl (Maikel Pennings) (1999-10-27) |
Re: handling exceptions jjones@cs.uiuc.edu (1999-10-28) |
Re: handling exceptions chstapfer@bluewin.ch (Christian Stapfer) (1999-10-28) |
Re: handling exceptions andi@complang.tuwien.ac.at (1999-10-29) |
Re: handling exceptions Gautier.deMontmollin@maths.unine.ch (Gautier) (1999-10-29) |
Re: handling exceptions guerby@acm.org (Laurent Guerby) (1999-10-29) |
Re: handling exceptions mslamm@mscc.huji.ac.il (Ehud Lamm) (1999-10-31) |
From: | Gautier <Gautier.deMontmollin@maths.unine.ch> |
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
http://members.xoom.com/gdemont/unzipada.htm
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).
--
Gautier
http://members.xoom.com/gdemont/gsoft.htm
Return to the
comp.compilers page.
Search the
comp.compilers archives again.