4 The Debugger

The debugger is an interactive tool for examining and manipulating the Lisp environment. Within the debugger you have access to not only the interpreter, but also to a variety of debugging tools. The default behavior when any error occurs is to enter the debugger. Users can then trace backwards through the history of function calls to determine how the error arose. They may inspect and alter local variables of the functions on the execution stack, and possibly continue execution by invoking a pre-defined restart (if available) or by forcing any function invocation on the stack to return user-specified values.

When writing an application it is possible to prevent entry to the debugger when an error occurs, by creating condition handlers to take some appropriate action to recover without user intervention. It is also possible to use restarts to specify some default methods of error recovery. The debugger is entered whenever an error is signalled (via a call to error or cerror ) and not handled by an error handler, or it can be explicitly invoked via a call to break .

You can use the debugger in REPL mode (that is, in the listener read-eval-print loop) or using the graphical Debugger tool in the Common LispWorks IDE. This chapter describes the REPL debugger; please refer to the Common LispWorks User Guide for details about the graphical Debugger tool.

The compiler generates information necessary for the use of the debugger during compilation. You can opt for faster compilation, at the expense of reducing the information available to the debugger. See under toggle-source-debugging in the LispWorks Reference Manual .

4.1 Entering the REPL debugger

4.2 Simple use of the REPL debugger

4.3 The stack in the debugger

4.4 REPL debugger commands

4.5 Debugger control variables

LispWorks User Guide - 11 Mar 2008