Request for Exception Handling Table Information

Mike Stump mrs@windriver.com
Mon Feb 7 17:48:00 GMT 2000


> From: "Mike Ludwig" <mike_ludwig@hotmail.com>
> Cc: gcc@gcc.gnu.org, mludwig@inprise.com

> A little background information may explain what information I am
> after.  We are looking at creating another language product on Linux
> and I am wanting to find out what would be needed to have GCC C++
> exceptions propagate through our stack frames and vice versa;

That's easy.  You don't need to do anything special.  :-) I say this
with my fingers crossed.  Just give -fexceptions when you compile.
People that use Fortran, Java, Ada, Objective C and Pascal can correct
me if I am wrong (I may be).

Now, if you don't use the virtual machine gcc uses (Java VM for
example), then you're going to have to do a bit to wire it in.

> further I am wanting to understand what GCC is doing when throwing
> or catching an exception (so as to either become compatible or at
> least not interfere with GCC exceptions).

Actually, I don't understand why you need to understand EH 's
implementation.  It will just work by default.  You should have to go
far out of your way to make it not work.

Take for example, switch statements.  You don't need to know anything
about how they are implemented in gcc, just the 5 or whatever routines
to start and end a switch statement, and the ones to introduce cases.
This is _all_ a person doing a frontend needs to know.  In fact, it is
desirable that they only know about the public interfaces, as then a
PhD student can come along and say, boy, your switch code can sure be
improved, do it, and no one will be the wiser, except for people that
benchmark.  :-)

For EH, the situation is the same.  I only want you to know about the
public calls in except.[ch] and to use what ones that may be
appropriate for your situation.

> W.r.t. the calls done at throw/catch points, what I want to
> understand is the interface that GCC is using into the runtime
> library to create/catch exceptions.  I don't know the location of
> any external documentation though I have looked through some of the
> source code.  So would you be able to point me to any of the
> archives that may contain documentation on the interface or give me
> a hint on relavent files to look at (b.t.w. I have looked at the
> file except.c in the gcc tree).

If what is provided by the backend currently isn't enough (for
example, it is not enough for EH in Ada and C++ to fully
interoperate), then it will need to be extended.  But, if it is
complete enough for you, then you can just stick to that interface.
The question is, is there some functionality that isn't provided that
you need?


Now, if you just want to learn about it, that's another matter, or if
you want to help work on it...  but these are separable from
implementing a frontend.

I wonder if the simplicity of the 3 things except.h provides is
obscured by all the documentation...  :-)


More information about the Gcc mailing list