CMU Common Lisp Debugger Quick Reference
CMU Lisp Debugger Quick Reference
See the complete CMU
Common Lisp User's Manual for details. This quick reference was
created by adapting material from that manual, by Philip Resnik.
Quick reference topics:
Seeing where you are
- error: re-displays the current error.
- backtrace: shows you where you are on the call stack.
Getting out of the debugger
- quit: Throws you out of the debugger, to the top level.
- restart n:
Invokes the nth restart case as displayed by the error
command. If n is not specified, the available restart cases are
reported.
- go:
Calls continue on the condition given to debug. If there is no
restart case named continue, then an error is signaled.
- abort:
Calls abort on the condition given to debug. This is useful for
popping debug command loop levels or aborting to top level, as the
case may be.
Looking at variables and their values
- Type the name of the variable for which you want to see the value.
- You can type list-locals to show the names and
values of all variables in this frame, or
list-locals "pref" to limit it to just variables
beginning with "pref", e.g. list-locals "foo" to list
local variables foo, foobar, and foodle.
Moving up and down the call stack
- backtrace: shows you where you are on the call stack.
- up:
Move up to the next higher frame. More recent function calls are
considered to be higher on the stack.
- down:
Move down to the next lower frame.
- top:
Move to the highest frame.
- bottom:
Move to the lowest frame.
- frame n:
Move to the frame with the specified number. Prompts for the
number n if not supplied.
Changing the maximum length and depth printed out
To set the global maximums to 5 and 10, respectively:
- (setf *print-level* 5)
- (setf *print-length* 10)
To change the values used just within the debugger:
- (setf *debug-print-level* 5)
- (setf *debug-print-length* 10)
Figuring out what file defines this function
If source file information is available you can use the following
(if not available, you'll get an error message when you try).
- source: identifies the source file.
Tracing function calls
In LISP (not the debugger):
- (trace FOO): turns tracing on for function FOO.
- (untrace FOO): turns tracing off for function FOO.
- (trace): shows what functions are being traced.
- (untrace): turns off tracing for all functions.