Re: Exception Handling

"Casse Hugues" <casse@netcourrier.com>
24 Jul 2002 02:28:41 -0400

          From comp.compilers

Related articles
Exception Handling david.jobet@ng-market.com (David Jobet) (2002-07-21)
Re: Exception Handling vbdis@aol.com (VBDis) (2002-07-24)
Re: Exception Handling casse@netcourrier.com (Casse Hugues) (2002-07-24)
Re: Exception Handling jacob@jacob.remcomp.fr (jacob navia) (2002-07-24)
Re: Exception Handling david.jobet@ng-market.com (David Jobet) (2002-07-25)
Re: Exception Handling journeyman@compilerguru.com (journeyman) (2002-08-04)
Re: Exception Handling nmm1@cus.cam.ac.uk (Nick Maclaren) (2002-08-10)
Re: Exception Handling marcov@toad.stack.nl (Marco van de Voort) (2002-08-10)
Re: Exception Handling max1@mbank.com.ua (Maxim Reznik) (2002-08-10)
[6 later articles]
| List of all articles for this month |

From: "Casse Hugues" <casse@netcourrier.com>
Newsgroups: comp.compilers
Date: 24 Jul 2002 02:28:41 -0400
Organization: Guest of ProXad - France
References: 02-07-075
Keywords: errors
Posted-Date: 24 Jul 2002 02:28:41 EDT
X-Comment-To: "David Jobet" <david.jobet@ng-market.com>

I uses the POSIX C functions setjmp()/lonjmp() from <setjmp.h> for
emulating exceptions in my C programs. These functions stores the
registers in a memory and restore it when the jump is performed. This is
the faster way to implement it I know (in C).
    But you must think about memory management because these functions
handle only the register and do not know anything about memory. Usually,
fast exception handling requires either special memory structure, or
garbage collection.


    H. Cassť.




On Sun, 21 Jul 2002 08:06:29 +0200, David Jobet wrote:


> Hi,
>
> I'm developping a compiler (for the fun) for a new language called
> Nosica. (http://nosica.ng-market.net)
>
> I'm stuck with exception implementation because I'm using C as as my
> assembly language.
>
> Finding docs for exceptions is not very easy, but I came to a model
> using custom setjmp /longjmp (because the standard C version appears to
> save a lot more than needed for C++ compatibility). ...
>
> Basically, I need to have the return address that the called function
> would return to if there was no exception thrown. In this case, the
> compiler could switch on this return value and produce the *good* code
> needed to clean up local variables.
>
> Problem is I don't know how to get this return address in order to
> produce the good case (here h_addr and f_addr).
>
> Is there any way to get them using assembly ?


Post a followup to this message

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