From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a461b4617646685c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!l8g2000yql.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: not catching exceptions Date: Wed, 20 Oct 2010 01:11:10 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4cbe2cc7$0$4845$9a6e19ea@unlimited.newshosting.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1287562270 8576 127.0.0.1 (20 Oct 2010 08:11:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 20 Oct 2010 08:11:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l8g2000yql.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009012111 Red Hat/3.0.6-1.el5 Firefox/3.0.6,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:15597 Date: 2010-10-20T01:11:10-07:00 List-Id: mark wrote on comp.lang.ada: > I'm targeting some Ada95 at three different systems. =A0One is a host > system running Linux, Intel based. =A0Exceptions are caught just fine. > Another is a bare board with a PowerPC running Linux. =A0Exceptions are > also trapped fine. =A0The third is a system running Linux but instead of > using glibc it uses uclibc. =A0Exceptions are not caught. =A0All I get is= an > abort message (abort). =A0The configure information for this one is below= - > > =A0 =A0$ ./powerpc-mpc8248-linux-uclibc-gcc -v > =A0 =A0Using built-in specs. > =A0 =A0Target: powerpc-mpc8248-linux-uclibc > =A0 =A0Configured with: ../../configure --prefix=3D/opt/atc/cpp_userchain > =A0 =A0/ppc8248-linux-toolchain --target=3Dpowerpc-mpc8248-linux-uclibc > =A0 =A0--with-cpu=3D603 --host=3Di686-pc-linux-gnu --build=3Di686-pc-linu= x-gnu > =A0 =A0--with-sysroot=3D/opt/atc/cpp_userchain/ppc8248-linux-toolchain/sy= sroot > =A0 =A0--enable-shared --enable-threads=3Dgnat --disable-tls > =A0 =A0--disable__cxa_atexit --enable-languages=3Dc,ada > =A0 =A0 Thread model: gnat > =A0 =A0 gcc version 4.1.2 > > I've tried this with both --enable-threads (POSIX model) and > enable-threads=3Dgnat. =A0I've tried with --enable__cxa_atexit and > --disable__cxa_atexit. =A0I can't seem to catch exceptions. > > A simple test program where I just raise and catch an exception gives > the same result...abort. =A0Outside 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 =A0would 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.