next up previous
Next: Debugger Commands Up: Psd for the Impatient Previous: Introduction

How to Debug a Procedure?

Write your Scheme program as usual. Start up an inferior Scheme session with the command M-x run-scheme. If the mode line of the *scheme* buffer says ``Inferior Scheme Psd: run'', then psd is already ready for use. If not, you will need to give the command M-x psd-mode in the Scheme buffer. To debug a procedure:

1.
Move the cursor on top of the procedure you want to debug.
2.
Type C-u ESC C-x. The procedure has now been instrumented, and you can place breakpoints within it.

3.
Put a breakpoint inside the procedure. Move the cursor to the line where you want to stop the execution and give the command C-x SPC. You can also set breakpoints by giving the name of a procedure where you want a breakpoint. Use the command C-c b for that.

4.
Run your program. When execution reaches a line with a breakpoint, the debugger is invoked and you can examine and change variable bindings etc.

5.
Once you have located and fixed the bug, simply load the corrected definition.


Gary T. Leavens
8/19/1997