From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: not catching exceptions
Date: Wed, 20 Oct 2010 01:11:10 -0700 (PDT)
Date: 2010-10-20T01:11:10-07:00 [thread overview]
Message-ID: <bb6f30ac-e433-4ef2-9ffa-352e60a17daa@l8g2000yql.googlegroups.com> (raw)
In-Reply-To: 4cbe2cc7$0$4845$9a6e19ea@unlimited.newshosting.com
mark wrote on comp.lang.ada:
> I'm targeting some Ada95 at three different systems. One is a host
> system running Linux, Intel based. Exceptions are caught just fine.
> Another is a bare board with a PowerPC running Linux. Exceptions are
> also trapped fine. The third is a system running Linux but instead of
> using glibc it uses uclibc. Exceptions are not caught. All I get is an
> abort message (abort). The configure information for this one is below-
>
> $ ./powerpc-mpc8248-linux-uclibc-gcc -v
> Using built-in specs.
> Target: powerpc-mpc8248-linux-uclibc
> Configured with: ../../configure --prefix=/opt/atc/cpp_userchain
> /ppc8248-linux-toolchain --target=powerpc-mpc8248-linux-uclibc
> --with-cpu=603 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
> --with-sysroot=/opt/atc/cpp_userchain/ppc8248-linux-toolchain/sysroot
> --enable-shared --enable-threads=gnat --disable-tls
> --disable__cxa_atexit --enable-languages=c,ada
> Thread model: gnat
> gcc version 4.1.2
>
> I've tried this with both --enable-threads (POSIX model) and
> enable-threads=gnat. I've tried with --enable__cxa_atexit and
> --disable__cxa_atexit. I can't seem to catch exceptions.
>
> A simple test program where I just raise and catch an exception gives
> the same result...abort. Outside of not being able to catch exceptions,
> everything else works great (tasking, protected types, etc).
>
> Any thoughts on why exceptions are not being trapped on the would be
> appreciated.
>
> Thanks.
I found this which may help:
http://gcc.gnu.org/ml/gcc/2007-07/msg00290.html
IIUC, you can enable exceptions on uClibc either by configuring the
cross-compiler to use the setjump/longjump (SJLJ) mechanism or by
patching uClibc to support zero-cost exceptions (ZCX). It is possible
that a newer version of uClibc is available that handles ZCX, possibly
with some configuration.
If you have more trouble, I suggest you ask on the GCC mailing list as
your question is quite technical and not specific to Ada (exceptions
are handled by the GCC back-end which is common to all languages).
--
Ludovic Brenta.
next prev parent reply other threads:[~2010-10-20 8:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 23:40 not catching exceptions mark
2010-10-20 8:11 ` Ludovic Brenta [this message]
2010-10-21 1:25 ` mark
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox