3 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 TTY mode (that is, from the listener command line) or using the dedicated debugger tool in the Common LispWorks environment. This chapter describes the TTY debugger; please refer to the Common LispWorks User Guide for details about the debugger tool.

The compiler generates information necessary for the use of the debugger during compilation. Users 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 .

3.1 Entering the TTY debugger

3.2 Simple use of the TTY debugger

3.3 The stack in the debugger

3.4 TTY debugger commands

3.5 Debugger control variables

LispWorks User Guide - 8 Apr 2005