comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adambeneschan@aol.com>
Subject: Re: Debugging Problem with Gnatbench under Eclipse
Date: Tue, 12 Nov 2013 17:12:01 -0800 (PST)
Date: 2013-11-12T17:12:01-08:00	[thread overview]
Message-ID: <6ea825d7-a48d-4fca-9fbc-1d17e1841343@googlegroups.com> (raw)
In-Reply-To: <45AGpDFh3jgSFwmZ@ada-augusta.demon.co.uk>

On Tuesday, November 12, 2013 6:40:33 AM UTC-8, Mike H wrote:

> One assumes that if the program compiles, it will 
> do what the source code says, nothing more and nothing less. If it does 
> not do what you believe it should do, the source code must be wrong. At 
> that point you have to swallow your pride and seek help from a colleague 
> (peer review!). I have never thought of that as debugging, perhaps it 
> means that Ada debugging is more usually done at source code level?

"Debugging", as I understand it, just means eliminating bugs (errors) from the program.  And Ada programs often do have bugs in them.  Ada has nice features that prevent certain kinds of errors that plague C and C++ programmers, but it does not prevent programmers from using an algorithm that doesn't work, or making a mistake when typing in an algorithm (although I hear that ARG is working on adding mind-reading features to Ada 202X that would help with that).  If your conception of "debugging" means examining machine instructions and registers and memory dumps, then that would explain why this discussion is confusing to me.  If a subprogram isn't working, because the source code is wrong, being able to step through it and examine the variables as they're computed can be a useful tool to help figure out what's going wrong.  It's a tool I definitely use.  It's not the only tool; I rely on my instincts to tell me whether to use a debugger, stick some Put_Lines into the code, or just study it harder, or something else.  But yes, this is almost always source-level debugging, using a debugger that understands Ada variables and types and works at that level.  It's rare that I'd have to resort to a memory dump or disassembly, unless perhaps there's an Unchecked_Conversion or dangling access causing a problem (or when I suspect a compiler bug).

I could be a little biased here, since the Ada debugger I use is one that I wrote.  So the suggestions on this thread, that debuggers are largely irrelevant to Ada programmers, is one that gets my dander up a bit.  They can be useful tools.  And I'd encourage the OP to try to get the vendor to fix the problem, since it's a tool he might find useful in the future.

                                -- Adam


  parent reply	other threads:[~2013-11-13  1:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11  2:27 Debugging Problem with Gnatbench under Eclipse Fritz von Braun
2013-11-11  5:40 ` Jeffrey Carter
2013-11-11 16:20   ` Mike H
2013-11-12  0:46     ` Fritz von Braun
2013-11-12 14:40       ` Mike H
2013-11-12 17:43         ` Bill Findlay
2013-11-13  1:12         ` Adam Beneschan [this message]
2013-11-13  8:18           ` Georg Bauhaus
2013-11-13  9:11             ` Dmitry A. Kazakov
2013-11-13 10:17               ` Simon Wright
2013-11-13 17:37             ` Jeffrey Carter
2013-11-13  9:14           ` Mike H
2014-02-10 17:40 ` john
replies disabled

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