[plt-scheme] Debugger: How much work to implement?

From: John Clements (clements at brinckerhoff.org)
Date: Thu Sep 23 11:38:22 EDT 2004

On Sep 22, 2004, at 8:03 PM, Eric Kidd wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> I'm curious as to how much work would be required to implement an
> mzscheme debugger.  (I've had a look at MzTake, which is quite
> impressive, but doesn't provide an obvious way to do some desirable
> things.  I've also tried searching with Google, and found only a few
> vague hints.)
> For the purposes of this discussion, a basic debugger would have the
> following features:
>   1) An API for debugging a program, perhaps in another namespace (no
> GUI required).
>   2) Single-stepping.
>   3) Enumeration of variables in scope at a given source location
> (including values).
>   4) Breakpoints.
>   5) Support for ordinary debugging in the presence of macros.
>   6) Evaluation of an expression in a given source location's scope.
> How much of this exists today?  How much is trivial to implement?  It
> would be desirable if the core features could run without MrEd.

Two of these are tricky in the current mzscheme framework: 
single-stepping (without destroying performance), and evaluation of an 
expression in a given source location's scope. Neither is impossible.

The rest is supported by the debugger back-end which is freely 
available--though not what you might call "polished", or even really 
"finished"--this is also the back-end used by mztake.

The way this back-end works is by elaborating user code to insert 
'with-continuation-mark' expressions which associate information about 
the state of the program with the continuation frames (or 'stack 
frames', if you prefer that term), and using 
'current-continuation-marks' at breakpoints to extract that information 

I can get more into the two tricky issues, if you'd like to hear more.

You should also be aware of the "errortrace" library, which provides 
only source positions but is useful for many debugging tasks.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2169 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20040923/0b0ebc55/attachment.p7s>

Posted on the users mailing list.