comp.lang.ada
 help / color / mirror / Atom feed
* GDB - El Capitan
@ 2015-10-16 17:33 Simon Wright
  2015-10-17  7:38 ` Simon Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2015-10-16 17:33 UTC (permalink / raw)


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

Also, it looks as though the Command Line Utilities don't include
Apple's gdb .. does anyone know whether Xcode does?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDB - El Capitan
  2015-10-16 17:33 GDB - El Capitan Simon Wright
@ 2015-10-17  7:38 ` Simon Wright
  2015-10-17 17:42   ` Jeffrey R. Carter
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2015-10-17  7:38 UTC (permalink / raw)


Simon Wright <simon@pushface.org> 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!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDB - El Capitan
  2015-10-17  7:38 ` Simon Wright
@ 2015-10-17 17:42   ` Jeffrey R. Carter
  2015-10-17 20:14     ` Simon Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffrey R. Carter @ 2015-10-17 17:42 UTC (permalink / raw)


On 10/17/2015 12:38 AM, Simon Wright wrote:
> 
> 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!

Which would have found your problem sooner: Your fight with GDB or some well
placed Put_Lines?

-- 
Jeff Carter
"Help! Help! I'm being repressed!"
Monty Python & the Holy Grail
67

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDB - El Capitan
  2015-10-17 17:42   ` Jeffrey R. Carter
@ 2015-10-17 20:14     ` Simon Wright
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Wright @ 2015-10-17 20:14 UTC (permalink / raw)


"Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> writes:

> On 10/17/2015 12:38 AM, Simon Wright wrote:
>> 
>> 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!
>
> Which would have found your problem sooner: Your fight with GDB or
> some well placed Put_Lines?

Hard to say; it turned out that I'd arrived at the right answer by the
unaided power of thought! and was able to use GDB to confirm.

I've got fairly accustomed to using arm-eabi-gdb to deal with low-level
hardware interfacing misunderstandings, where it was invaluable (not
least because of having nowhere for the Put_Lines to go.)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-17 20:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16 17:33 GDB - El Capitan Simon Wright
2015-10-17  7:38 ` Simon Wright
2015-10-17 17:42   ` Jeffrey R. Carter
2015-10-17 20:14     ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox