Re: How to debug in Common Lisp?



På Thu, 03 Jan 2008 14:15:53 +0100, skrev <Ryuwen@xxxxxxxxx>:

Maybe you can share some skills about the debuging in Common Lisp.
I want to get a quick and useful method for debuging.
I am using Allegro CL 7.0 (w IDE, Modern).
Thanks in advance!

First I use LispWorks which has a diferent GUI debugger.
Mostly I just write a function then test it. The exception is in web pages where you need the session thread context and testing won't do. Then I just set a breakpoint in the code and use the GUI debugger. I start by looking at the stack. Checking local vars are as expected. Then I set a new breakpoint past the point of some actions and test again. Sometimes I run code using data in the local stack frame. Sometimes I want it to stop before a particular set of data breaks the code so I use a conditional breakpoint. In extreme cases where I can't locate the bug I comment half the code out and check whether I still get the error. The offending line is then effectively found by binary search. For checking data flow logging data to a file is good alla "entered here with params" and "returned this value". Indenting for each nested call helps visually. Finally like Kenny I sometimes insert format statements at strategic points to check the data.

I don't know of any quick and useful way of debugging. Much of figuring out errors is having seen a similar message before and having a idea what caused it. Similar with technique's. Everyone seems to have their own way. Only with experience does it become easier.

Nevertheless maybe the pointers above will give you some ideas.
But mostly learn how to use the debugger and be creative about it. See it as a challenge rather than a burden and soon the skill will come naturally.

--------------
John Thingstad
.



Relevant Pages

  • RE: AppVerifier breakpoint when closing VB6 application
    ... You can run!avrf debugger extension and follow the troubleshooting steps ... handle checks are enabled, Appverifier keeps track of open, close and any ... I am getting 2 breakpoint exceptions from AppVerifier upon closing my ... ModLoad: 00400000 004d5000 MyApp.exe ...
    (microsoft.public.win32.programmer.tools)
  • Re: [RFC] hwbkpt: Hardware breakpoints (was Kwatch)
    ... The debugger should always eat the trap. ... agent who asked for the breakpoint and who is responsible for responding to ... some question about what value the debug exception handler should write ... For most other machines this will be a no-op. ...
    (Linux-Kernel)
  • Re: [git pull] kgdb-light -v10
    ... The reality is that KGDB is not self contained. ... With the recursion counter the only problem would be someone ... It also has several special checks against the breakpoint situation I ... the end of the day that is all you can do if you re-enter the debugger ...
    (Linux-Kernel)
  • Re: Breakpoint instantiation
    ... don't have any debugger configured in the Target Device Connctivity ... so I can download the image. ... Also I cannot connect to the device with the remote tools. ... Could the breakpoint problem be related with this? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: BDS2006: has the debugger gone mad or have I?
    ... If I set a breakpoint on a line of code, the debugger will stop there, but pressing F8 will have the debugger jump to some completely random part of the source, and a subsequent F9 will cause havoc. ... The breakpoint I'm trying to set is in a package which is not loaded explictly by the host program, but rather by another package which is loaded by another package etc etc which the host program DOES load. ... The debugger shows the correct source file, and I know that is looking at code in that source file 'coz an added call to ShowMessage in that source file is actually executed. ...
    (borland.public.delphi.non-technical)