This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/19620] exception not caught when passing through C code


------- Additional Comments From jkanze at cheuvreux dot com  2005-01-31 09:55 -------
Subject: Re:  exception not caught when passing through C code



> This is documented somewhere in the docs, I think.  If you mix C
> codes with C++ and exceptions are raised (through callbacks) and
> you need exceptions to smoothly travel across language
> boundaries, you need to compile the C code with -fexceptions.

The problem is that you don't always have the sources for the C
code.  Most of the time, it is in some third party library for
which you only have the .h's and the .a (or .so).  (And the
third party library has likely been compiled with Sun's cc, not
gcc.)

I'll admit that I don't understand the problem, at least on
Sparc.  There is an ABI which defines what the C stack looks
like; the C++ stack is, in fact, identical.  Walking back the
stack is trivial.  The only thing you need the tables for is for
finding destructor or handler code.  So you won't find them in
the C code which doesn't have the tables; that's no problem,
because I'm pretty sure that the C code doesn't have any
destructors, nor any exception handlers.

Is there something linked with portability which precludes this
approach.  (I know that the stack walkback code is NOT portable.
But I would have thought that this was true with or without the
tables.)

--
James Kanze        GABI Software       mailto: jkanze@cheuvreux.com
Conseils en informatique orientée objet/
                   Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

"This message, including any attachments may contain confidential and
privileged material; it is intended only for the person to whom it is
addressed. Its contents do not constitute a commitment by Credit Agricole
Cheuvreux except where provided for in a written agreement. Credit Agricole
Cheuvreux assumes no liability or responsibility for the consequences
arising out of a delay and/or loss in transit of this message, or for
corruption or other error(s) arising in its transmission and for any misuse
or fraudulent use which may be made thereof. If you are not the intended
recipient, please contact us and abstain from any disclosure, use or
dissemination. To the extent that this message contains research
information and/or recommendations, these are provided on the same basis as
Credit Agricole Cheuvreux's published research and the recipient must have
regard to all disclosures and disclaimers contained therein."





-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19620


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]