[asdf-devel] lisp source debugger
Robert Goldman
rpgoldman at sift.info
Sat May 12 22:24:10 UTC 2012
On 5/12/12 May 12 -5:14 PM, Faré wrote:
> On Sat, May 12, 2012 at 6:08 PM, Yuan Luo <yuan.hypnos.luo at gmail.com> wrote:
>> Hi,
>> This maybe an irrelevant question, if so, please point me to the best list
>> to ask. But I am wondering whether you guys can recommend some source level
>> debugger that can POINT ME PRECISELY to where the error was. For example,
>> Allegro CL cannot because many times it tells me that there is an error in a
>> function, but it doesn't tell me which line even if I set their debug flag
>> to 3 the highest level and suppressed everything else, speed, optimization
>> etc. (my function has hundreds of lines then I am frustrated ...)
>>
> Which implementation are you using?
> SLIME on SBCL can give you source location,
> even inside internal functions (from labels or flet or lambda).
> Be sure to compile with (safety 3) (debug 3) (speed 1) or so.
>
> That said, this is not the most appropriate forum for this question.
> After you try the above, ask for help on #lisp, stackoverflow,
> comp.lang.lisp, etc.
Ditto. TRACE is your friend, particularly TRACE with some of the more
exotic options, such as
(TRACE (<POSSIBLY-BAD-FUNCTION> :INSIDE <LOCATION-OF-BUG>))
where <LOCATION-OF-BUG> is the location that you get from Allegro
telling you where your program failed. There should be a relatively
small number of function calls inside this function, if you lisp is
written normally (typically no multi-page functions, although there are
always exceptions).
Also, you should be able to investigate *from inside the debugger*. If
there's a function call (FOO X Y) inside the function that's breaking,
execute (FOO X Y) within the debugger, first checking to see what X and
Y are in this stack frame, and see what happens. Repeat until your bug
is found ;-)
r
More information about the asdf-devel
mailing list