I'm using CCL on Mac (1.8.1 -- the latest available at this writing), and wondering if there's any sort of debugging tutorial available.
The thing I'm particularly interested in is setting a breakpoint somewhere in my code, then poking & prodding various values, then stepping over the next line of code, checking more values, etc.
EDIT: I've read the debugging section of the CCL manual (18.3 and thereabouts), but can't quite make sense of it. I'm coming from a C/Java/etc. background and IDE-based source level debuggers, with just a little exposure to gdb.
So I guess what I'm looking for is an introduction/tutorial that walks me through a few of the simpler steps.
(I'm new to Lisp (and CCL, of course) so, if I'm asking completely the wrong question or going about things completely the wrong way, feel free to let me know.)
Thanks!
I am sure a CCL user might point you to the Debugging section in the CCL manual, but, in fact, the ANSI Common Lisp standard includes excellent debugging facilities, including
break
andstep
you asked about (except forstep
's granularity is not based on a line of code but rather a form).In fact, the whole Condition System is worth examining.
There are a few tutorials too.
The most important thing to remember that the debugging tools give you the normal Lisp REPL (Read-Eval-Print Loop) where you can do just about anything you can do with the initial REPL: define functions and variables, examine the existing variable (including those defined in the functions in which the debugger was entered) et al. Additionally, you might be able to issue additional commands, like
step
andnext
(often abbreviated:s
and:n
) in the stepper orcontinue
(often abbreviated:c
) in a continuable error.One difference you need to watch for is that in
gdb
you examine a variablex
usingprint x
(abbreviatedp x
) while in Lisp you just typex
and it is evaluated.Here are some simple examples:
Step
Here
?
gives help on available commands; tryhelp
or:h
if your lisp barfs.Note that the prompt inside the stepper is
step <level>
wherelevel
is the nesting level.Break
Here the prompt is
Break <level>
.Assert
assert
uses the same prompt asbreak
.in ccl, you can use
cl-stepper:step
instead ofcl:step
.(ql:quickload "com.informatimago.common-lisp.lisp.stepper")
The simple answer you are looking for is given by juanitofatas. Unfortunately CCL does not support step and hence is weak in debugging. Until now the best implementation to debug is CLISP.