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-Thread: 103376,93a8020cc980d113 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeeds.sol.net!10.218.45.202.MISMATCH!newspump.sol.net!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: What is wrong with Ada? Date: Mon, 16 Apr 2007 12:45:11 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1176150704.130880.248080@l77g2000hsb.googlegroups.com> <461B52A6.20102@obry.net> <461BA892.3090002@obry.net> <82dgve.spf.ln@hunter.axlog.fr> <1176226291.589741.257600@q75g2000hsh.googlegroups.com> <4eaive.6p9.ln@hunter.axlog.fr> <1176578930.062156.49570@b75g2000hsg.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1176741911 6131 192.74.137.71 (16 Apr 2007 16:45:11 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 16 Apr 2007 16:45:11 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:TWZHZcuKpQ6pXLY/i0h8ln8LzzY= Xref: g2news1.google.com comp.lang.ada:15064 Date: 2007-04-16T12:45:11-04:00 List-Id: Jean-Pierre Rosen writes: > OK, take a typical example (of what I am doing, YMMV). In an ASIS > program (AdaControl of course), I have a failure due to an > "inappropriate element" to a given call, that I can easily identify from > the stack trace. That place is called very often, just once in a while > is the parameter incorrect. With a trace, I just have to read the last > message befor the failure. But since I don't know beforehand how many > times the sequence is called before failing, I would have to break on > any occurrence - maybe hundreds. Not counting the fact that it is after > I type "continue" that the program fails, and that I know that I just > restarted from the point where I should have been investigating! I used a debugger for OCaml that can execute backwards. So you stop at the failing assertion/check, and back up to see how you got there. You can execute backward to a breakpoint, or single step backward. Very useful in this sort of case. In more primitive debuggers, you could still do various things without using trace statements in the code. E.g. you could set a breakpoint on the assertion, and another on the failure of the assertion. Disable the former. Run. Tell the debugger to print out the count for the former. Start over, with former enabled, telling it to stop after N-1 times. Now single-step toward the bug. Of course, if it's flaky, you're out of luck. Having said all that -- I do sometimes use trace statements in the code. E.g. when I suspect the debugger is telling a fib. Or when I want to analyze the log using editor searching or the like, after the fact. - Bob