LISPDEBUG
Introduction
Although LISP is easy to debug and has some
nice debugging tools (trace, step ...) there exist still a niche for a
source level debugger. Most commercial implementations of LISP have indeed
a source level debugger but in most free versions of LISP such a debugger
is missing.. For this raison I started to develop myself a source level
debugger and the result of this effort is LISP DEBUG.
LISP DEBUG is a client server system,
when you start a debugging session in LISP a server program ('interface')
is started, which provides a GUI to the debugger. Your debugged program
is then communicating with this server to display debugging info (sources
, highlighting breakpoints ....) and is controlled by itself by the server
program. The server is written in C and uses TCL/TK for the GUI part (I
would like to write the GUI also in LISP but it is a sad fact that there
is no common high level graphical standard for the different LISP systems).
Server and the LISP system communicates via sockets.
LISP DEBUG works by instrumentation, debugging
code is added to each LISP form in a source. The debugging code will call
the debugger before evaluating the form.. The debugging code passes position
info and lexical environment info to the debugger. Breakpoints, watch points
and evaluation of expressions uses this extra information. The extra code
is added by parsing the lisp source and generating a temp file containing
the debugged code, this file is then loaded in the LISP system.
LISP macro's are a known problem for instrumentation
of code, a LISP programmer can use macro's to define his own control structures
and it is then not clear which part must be debugged and which part not.
It is for this raison that the parser/generator of LISP DEBUG is extensible.
The parser/generator is actually LISP code resulting from compiling a extension
language. This extension language is loosely based on the syntax diagrams
found in CLTL2 and should be easy to modify.
Features
-
Step (start
executing and stop at the next lisp form to be executed)
-
Step Over
(start executing and stop at the next lisp form in the same parent list)
-
Next (start
executing and stop at the highlighted form)
-
Continue
(start executing , stopping only at the next breakpoint)
-
Profiling
of code is possible
-
Support for debugging multisource
code
-
Debug granularity is the LISP form level (finer
then line level)
-
Halting is possible before and after execution
of a LISP form
-
You can change
the result of the execution if halted after execution of an expression.
-
The debugger is entered automatically if a
debugged program encounter a continuable LISP error. The debugger will
also try to display the faulty code.
-
Time traveling
(you can examine the state of previous executed forms).
-
Designed to be portable
Supported Platforms
-
GCL 2.2.2 or higher (not on SPARC platforms).
I was unable to test the debugger on GCL 2.3 (due to compilation problems
of gcl-tk (I don't actually need TCL/TK in the lisp system but I use the
gcl-tk event processing).
-
CMUCL 18b or higher
-
CLISP (must be higher or equal than version
1999-07-22 (July 1999))
-
ACL version 5 (Allegro Common Lisp).
-
Needs TCL/TK version 8.1 (or 8.2) and support
for sockets
-
I have tested only on LINUX but it should
work on other systems
Screen shots
Download
Other debuggers
Contact
If you have problems,
suggestions concerning my debugger or if you want to port it to another
platform, feel free to contact me at mmertens@akam.be