Question about EH

Tom Tromey
Wed Feb 23 11:26:00 GMT 2000

>>>>> "Mike" == Mike Stump <> writes:

Tom> Currently, you can't `catch' a Java exception in a C++ function

Mike> Well, this is a java issue.  If you want to find the g++
Mike> entries, you will need to figure out a mapping between C++ and
Mike> Java that you like, and extend the Java matcher to handle the
Mike> union case better.

I don't see how we can do this.

Per (I think) added Java type support to the C++ compiler.  Java
objects are a lot like C++ objects, but they aren't the same in every
respect.  For instance, Java objects don't use the C++ notion of RTTI
-- Java has its own way of doing this.

If I have a pointer to a random collection of bits (which is what I
have in the type matcher, I think), I don't think that there is a way
to determine whether it is a C++ object or a Java object.

Mike> If you start small "i" (the mangling for the `int' type in
Mike> C/C++), and just catch those in java (from a throw 1; in C++),
Mike> you will get a feel for it.

This is the start of the impossible things.  In Java it is only
possible to throw a Java object derived from java.lang.Throwable.  (In
C++ terms this is the same as throwing a pointer to that object -- in
Java you can only have object references.)


More information about the Gcc mailing list