Re: How to debug in Common Lisp?
- From: "John Thingstad" <jpthing@xxxxxxxxx>
- Date: Fri, 04 Jan 2008 12:20:05 +0100
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
.
- References:
- How to debug in Common Lisp?
- From: Ryuwen
- How to debug in Common Lisp?
- Prev by Date: Re: What language(s) do you use at work?
- Next by Date: Re: CLOS persistence
- Previous by thread: Re: How to debug in Common Lisp?
- Next by thread: Re: Is there any library in common lisp that similar the "telnetlib" in Python.
- Index(es):
Relevant Pages
|
|