From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: ada loops
Date: 31 May 2003 12:19:32 -0400
Date: 2003-05-31T12:19:32-04:00 [thread overview]
Message-ID: <wccbrxjks17.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: u65nsp1as.fsf@wanadoo.fr
Pascal Obry <p.obry@wanadoo.fr> writes:
> Robert A Duff <bobduff@shell01.TheWorld.com> writes:
>
> > There is no version of gdb that is Ada aware.
>
> This is of course plain wrong !
I was being somewhat sarcastic. ;-)
Of course I am well aware of the version of gdb distributed with GNAT,
and I use it. However, almost every time I use it in any serious way,
it shows some confusion about Ada. For example, it thinks a parameter
of type String is actually of type pointer-to-String. Often, it can't
find objects that are (or should be) visible -- I'm not sure exactly
what's going on, but I think it is confused about nested block
statements, and nested procedures. Another example is that it often
crashes when I try to call a procedure with anything but the simplest of
parameter types.
Calling procedures is a very useful feature of any debugger -- it allows
you to print out data stuctures in a higher-level form than a plain
listing of record fields and whatnot. But it only works half the
time, in my experience.
Another example: I have a generic package that is instantiated 20 times,
and I want to call one of the procedures. Gdb will then ask me which of
the 20 I meant. If it were truly Ada aware, it would know which one,
based on the types of the actual parameters -- that's what the compiler
knows how to do.
The OP complained that gdb did something obviously wrong, and somebody
responded saying it must be caused either by a bug in the Ada program
that destroyed memory, or by using the wrong version of gdb. That's not
my experience at all; the GNAT version gdb lies to me and/or crashes
quite often, even when there are no memory-destroying bugs around
the place. (Those bugs are quite rare in Ada, after all, given all the
good array-bounds checking and whatnot.)
So I stand by my claim: There is no version of gdb that is Ada aware.
Gdb is a C debugger. The GNAT version understands some part of Ada,
and it does improve over time, but it's still got a long way to go
before it understands Ada as well as, say, the GNAT Ada compiler!
Having said all that, I don't use debuggers very heavily. Usually just
to get a stack traceback for an unhandled exception. I think it's
usually better to try to understand the code I write, rather than to
throw something together and then spend all day rummaging around in the
debugger to see what's going on.
- Bob
next prev parent reply other threads:[~2003-05-31 16:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-30 15:44 ada loops Roman V. Isaev
2003-05-30 16:00 ` Bill Findlay
2003-05-30 16:17 ` Robert A Duff
2003-05-30 16:46 ` Bill Findlay
2003-05-30 16:51 ` Bill Findlay
2003-05-30 17:25 ` Stephen Leake
2003-05-30 19:40 ` Robert A Duff
2003-05-30 21:33 ` Pascal Obry
2003-05-31 16:19 ` Robert A Duff [this message]
2003-05-31 16:29 ` Robert A Duff
2003-05-30 21:38 ` Simon Wright
2003-05-30 21:51 ` chris.danx
2003-05-31 6:40 ` Pascal Obry
2003-05-31 16:21 ` Robert A Duff
2003-06-02 16:39 ` Stephen Leake
2003-05-31 16:24 ` Oliver Kellogg
2003-05-31 23:15 ` Preben Randhol
2003-06-05 5:14 ` Dave Thompson
2003-06-05 18:15 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox