[plt-scheme] debugging in PLT Scheme

From: Gregory Cooper (greg at cs.brown.edu)
Date: Sun Dec 3 13:32:10 EST 2006

Hi Geoffrey,

There's a short blurb in the Help Desk under "debug button" that
documents how to do these things.  It's not very detailed, though, so
I'll point out a few caveats.

> * Breakpoints

To set a breakpoint at the beginning (end) of an expression,
right-click on its left (right) paren, and a popup menu should appear
with the option to "pause at this expression".  If you select that
option, a small red circle will appear over the paren, and the program
will stop at that point.  However.

* Not all expressions support breakpoints.  If you mouse over a
breakable paren, a ghosted circle will appear.
* If an expression is in tail position, you cannot break at the end of it.
* If your program is not in the (module ...) language, the debugger
only discovers which expressions are breakable after they are fed to
the evaluator.  However, in recent versions (since v350 at least), the
debugger remembers the set of breakable expressions (and breakpoints)
across consecutive invocations.  So, if you click Debug, then Continue
to let the program run to completion, then Debug again, you should
have immediate access to all the breakable expressions.

> * Current Values
> What I'd really like to do is see what values `date' and `special-
> sundays' hold, without changing any code.  Is there a way to do that?

If 'date' and 'special-sundays' are lexical variables (not top-level),
mousing over them should display their values up next to the debugger
controls (opposite where the expression value appears).  In addition,
if you right-click on the variable in the Definitions Window, there
should be an option to print the value in the Interactions window.

If any of this doesn't work, please let me know, and I'll look into it
right away.

Greg


Posted on the users mailing list.