gcc-4.1.1 and exception handling (libstdc++)

Ed Swierk eswierk at arastra.com
Fri Aug 11 01:30:32 UTC 2006


On 8/10/06, Peter S. Mazinger <ps.m at gmx.net> wrote:
> I did some tests with gcc-4.1.1/uClibc-svn and the only working
> configuration to run throw2.cpp test file is to use
> unwind-dw2-fde-glibc.c (and not unwind-dw2-fde.c as it does now in
> buildroot), the --enable-sjlj-exceptions does not help either.
>
> --enable-sjlj-exceptions is needed though for all gcc<4 (despite the
> changes in buildroot saying that only gcc-3.3 needed this)
>
> Tests were done on x86

I can run throw2.cpp (with an ERROR on catching float) using gcc-4.1.1
and uClibc-20060720 on x86 and powerpc. I built gcc with
--enable-sjlj-exceptions and --enable-__cxa_atexit; the latter fixes
segv on exit in C++ shared libraries, but probably has nothing to do
with exceptions.

1  Throwing out_of_range()
    Catching: out_of_range out_of_range meaningful comment
2  Throwing exception()   // Can't specify comment
    Catching: St9exception
3  Throwing underflow_error  // caught by base class (runtime_error)
    Catching: runtime_error underflow_error
4  Throwing runtime_error
    Catching: runtime_error a comment
5  Throwing length_error   // caught be super-super-class (exception)
    Catching: St9exception
6  Throwing int
    Catching: int 26
7  Throwing const char*
    Catching: const char* This is a const char*
8  Throwing string
    Catching: string I'm a string
9  Throwing float
    ERROR: Nobody caught this!
10  Throwing up

--Ed



More information about the uClibc mailing list