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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b8f4ad9d302b143 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-31 09:19:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!news-hog.berkeley.edu!ucberkeley!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: ada loops Date: 31 May 2003 12:19:32 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1054397972 12344 199.172.62.241 (31 May 2003 16:19:32 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 31 May 2003 16:19:32 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:38222 Date: 2003-05-31T12:19:32-04:00 List-Id: Pascal Obry writes: > Robert A Duff 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