This is the mail archive of the
mailing list for the Archer project.
Re: C++ Exceptions Status
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Project Archer <archer at sourceware dot org>
- Date: Wed, 06 Aug 2008 15:37:36 +0100
- Subject: Re: C++ Exceptions Status
- References: <48999B3C.email@example.com> <firstname.lastname@example.org>
Ian Lance Taylor wrote:
Phil Muldoon <email@example.com> writes:
The issue that I am currently wrestling with is how specific is this
unwind and exception work to C++? Are Java and Python exceptions
handled in the same way? And how can we avoid language specific
semantics in very general commands like "next"? Can we?
The system you described is specific to systems that follow the
Itanium C++ ABI (http://www.codesourcery.com/public/cxx-abi/). gcc
follows that ABI on most systems, not just Itanium systems.
Yep totally, I should have pointed that out. Thanks for doing that, and
posting the link. I also found the unwinding description in this document:
very lucid too.
On some systems gcc uses an exception handling system based on setjmp
and longjmp. This will be used if you configure gcc with
--enable-sjlj-exceptions. That is the default on HP/UX 10 and for
older ARM targets.
The existing "next" code should hopefully catch that via its existing
longjmp/setjmp logic. But yeah, there is a lot of sjlj specifics defines
throughout the code. Point well taken. Step two is to look at how C++
exceptions work here - when I can acquire a suitable target.
When compiling with gcc to native code, Java exceptions are handled
the same way as C++ exceptions. When compiling to Java bytecode,
exceptions are presumably handled within the JVM. Most JVMs have
various debugging hooks, but I don't know much about it.
Python is not normally compiled to native code, and exceptions are
handled within the Python interpreter. I don't know much about that
Did not know either of these facts, thanks for adding. My main concern
is any solution that is proposed for C++ works in harmony with as many
platforms and language exception handling methods as possible. Beyond
that, I'm still investigating how to actual effect a change in "next" so
it works with C++ exceptions ;)