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,d5b211b0c1ffcf3e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.193.129 with SMTP id ho1mr2987228pbc.8.1340361841134; Fri, 22 Jun 2012 03:44:01 -0700 (PDT) Path: l9ni6548pbj.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!newsfeed.x-privat.org!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Tero Koskinen Newsgroups: comp.lang.ada Subject: Re: Practicalities of Ada for app development Date: Fri, 22 Jun 2012 13:43:59 +0300 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: <20120622134359.a548b199003c81c82edfd952@iki.fi> References: <79c5c9f7-4b72-4990-8961-b3e2db4db79b@qz1g2000pbc.googlegroups.com> <92daaca1-46ae-43e1-abae-397b4bf6aa33@googlegroups.com> NNTP-Posting-Host: dsl-trebrasgw2-fe9cde00-96.dhcp.inet.fi Mime-Version: 1.0 X-Trace: munin.nbi.dk 1340361839 1638 80.222.156.96 (22 Jun 2012 10:43:59 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 22 Jun 2012 10:43:59 +0000 (UTC) X-Newsreader: Sylpheed 3.2.0beta6 (GTK+ 2.24.10; x86_64-redhat-linux-gnu) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: 2012-06-22T13:43:59+03:00 List-Id: On Thu, 21 Jun 2012 13:30:18 -0700 (PDT) Adam Beneschan wrote: > On Thursday, June 21, 2012 12:18:52 PM UTC-7, J-P. Rosen wrote: > > In general, I get /thousands/ of useless messages (and I can't predict > > how many) before the one I'm interested in, that is, the last one before > > the crash. I don't care, I just let the screen scroll... How could I do > > that in a debugger? A breakpoint, and thousands of useless "go" > > commands? No thanks. > > Actually, that's a typical case where I find a debugger useful. At the point where you add the trace message, I set a breakpoint, but set it up so that it continues automatically and doesn't display any message. Then when the crash occurs, I ask the debugger to display information on the breakpoint, and find that it occurred N times. Then I rerun the program, and set a breakpoint at that same place, telling the debugger to stop the program after it's hit that place N-1 times. That way, I can see what's going on just before the crash. Sometimes when the buggy program is unknown to me, I wrap the debugger (gdb) inside an Expect script, set breakpoint to the start of the main procedure, and instruct the script to send "go until next source code line" to the debugger until the buggy program crashes. Depending on the size of the program, this might take hours, but I get automatically strace of every source code line (since gdb prints them for me) before the crash all the way from the beginning of the program and I don't even need to turn on separate tracing from the source code. Also, if I am interested in some variable, I can instruct either gdb or my Expect script to display it before continuing to the next line. Btw, you Ada compiler vendors have it easy. Just imagine if Ada would be a weakly-typed just-in-time compiled scripting language ran inside the browser (on embedded device for extra kicks) when something happens on the web site and you would have to debug why the browser crashes when a certain script is run. ;) -- Tero Koskinen - http://iki.fi/tero.koskinen/