[slime-devel] Debugging SBCL...

Tobias C. Rittweiler tcr at freebits.de
Sat Mar 27 08:47:07 UTC 2010


"Tobias C. Rittweiler" <tcr at freebits.de> writes:

> Andrei Stebakov <lispercat at gmail.com> writes:
>
>> I am trying to debug a web app (based on hunchentoot and weblocks).
>> Let's say I have a function
>>
>> (defun test-func(a)
>>   (let ((b 1)
>>         (c 2))
>>     (break)))
>>
>> I call this (test-func 0) from (defun weblocks-dispatcher (request) ....)
>> When I hit break, am I supposed to see a, b and c as local variables in the
>> frame?
>> All I can see is the request parameter of weblocks-dispatcher and not even
>> the frame for test-func, what I am missing?
>>
>> Backtrace:
>>   0: (BREAK "break")
>>       Locals:
>>         SB-KERNEL::ARGUMENTS = NIL
>>         SB-KERNEL::DATUM = "break"
>>   1: (WEBLOCKS::WEBLOCKS-DISPATCHER #<HUNCHENTOOT:REQUEST {CFAAB71}>)
>>       Locals:
>>         SB-DEBUG::ARG-0 = #<HUNCHENTOOT:REQUEST {CFAAB71}>
>>
>>
>> I am using the very latest SBCL 1.0.36 and latest cvs slime.
>>
>> Thank you,
>> Andrei
>
> Maybe the call to TEST-FUNC is a tail call and hence optimized away by
> SBCL? Try recompiling WEBLOCKS-DISPATCHER with a higher debug
> settings. 

Silly me answering mails in the morning before really being waked up;
the call to BREAK in your TEST-FUNC is a tail call, and hence the stack
frames of TEST-FUNC is reused for BREAK. Try recompiling TEST-FUNC with
higher debug settings, or move the call to break out of tail call
position.

  -T.





More information about the slime-devel mailing list