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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GDB - El Capitan Date: Sat, 17 Oct 2015 08:38:55 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="20fbd190bb9d0acbcc1326050ba852dd"; logging-data="25967"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//jQ1m9lZUHCl6QgTbA0rK0VLfW/LY+F4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:OZMTjM7L5r+ALLnq1MXboWKKcd4= sha1:sTqSRZxbjsN8rJ08ylD6mD1W1TU= Xref: news.eternal-september.org comp.lang.ada:27991 Date: 2015-10-17T08:38:55+01:00 List-Id: Simon Wright writes: > Has anyone managed to get the AdaCore GDB to catch exceptions on El > Capitan? > > The problem I reported back in 2011 at [1] is still there. The 'p > __gnat_debug_raise_exception' trick no longer works; the '-readnow' > trick at least lets you say 'catch exception', but if you try to catch a > specific exception it then reports > > (gdb) catch exception constraint_error > warning: failed to reevaluate internal exception condition for > catchpoint 0: A syntax error in expression, near `e) = long_integer > (&standard.constraint_error)'. Catchpoint 1: `constraint_error' Ada > exception > > and stops on all exceptions (I think it actually gets hung up, so 'c' > ends up at the same place). > > At least this time it fails in the same way with GNAT GDB 2015, so we > *may* get a hint from AdaCore. > > [1] https://sourceware.org/bugzilla/show_bug.cgi?id=11385 Aha! The workround is to use the '-readnow' flag and to 'set language ada' before 'catch exception'. I guess that if you're debugging a mixed-language program you could then 'set language auto' ... hmm, no. Still, I'm saved from Put_Line's all over the place!