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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.27.36 with SMTP id q4mr12513791obg.7.1384305122301; Tue, 12 Nov 2013 17:12:02 -0800 (PST) X-Received: by 10.50.87.71 with SMTP id v7mr446380igz.11.1384305122246; Tue, 12 Nov 2013 17:12:02 -0800 (PST) Path: border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!xlned.com!feeder1.xlned.com!news.glorb.com!o2no31878101qas.0!news-out.google.com!9ni24597qaf.0!nntp.google.com!i2no22905190qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 12 Nov 2013 17:12:01 -0800 (PST) In-Reply-To: <45AGpDFh3jgSFwmZ@ada-augusta.demon.co.uk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: <5384e37a-764a-4368-8834-0de4c7d7998c@googlegroups.com> <46F25mG2OQgSFw2s@ada-augusta.demon.co.uk> <3d734e02-f7eb-4a32-86ca-0d56e059e276@googlegroups.com> <45AGpDFh3jgSFwmZ@ada-augusta.demon.co.uk> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6ea825d7-a48d-4fca-9fbc-1d17e1841343@googlegroups.com> Subject: Re: Debugging Problem with Gnatbench under Eclipse From: Adam Beneschan Injection-Date: Wed, 13 Nov 2013 01:12:02 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 3775 Xref: number.nntp.dca.giganews.com comp.lang.ada:183843 Date: 2013-11-12T17:12:01-08:00 List-Id: On Tuesday, November 12, 2013 6:40:33 AM UTC-8, Mike H wrote: > One assumes that if the program compiles, it will=20 > do what the source code says, nothing more and nothing less. If it does= =20 > not do what you believe it should do, the source code must be wrong. At= =20 > that point you have to swallow your pride and seek help from a colleague= =20 > (peer review!). I have never thought of that as debugging, perhaps it=20 > 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 fe= atures that prevent certain kinds of errors that plague C and C++ programme= rs, 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 th= at ARG is working on adding mind-reading features to Ada 202X that would he= lp with that). If your conception of "debugging" means examining machine i= nstructions and registers and memory dumps, then that would explain why thi= s discussion is confusing to me. If a subprogram isn't working, because th= e source code is wrong, being able to step through it and examine the varia= bles as they're computed can be a useful tool to help figure out what's goi= ng 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 in= to 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 r= esort to a memory dump or disassembly, unless perhaps there's an Unchecked_= Conversion or dangling access causing a problem (or when I suspect a compil= er 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 irre= levant to Ada programmers, is one that gets my dander up a bit. They can b= e useful tools. And I'd encourage the OP to try to get the vendor to fix t= he problem, since it's a tool he might find useful in the future. -- Adam