[racket] Searching console debugger...

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sat Oct 4 13:26:47 EDT 2014

I don't know of one, but if you don't find one...

There are a few different ways that you can use a custom "#lang" to 
instrument modules for debugging and make your own debugger.  You can 
wrap the top-level procedure definitions, define your own apply 
procedure procedure, or (harder) try to parse procedure bodies and 
instrument at that level and perhaps have access to every continuation 
and syntactic construct that way.  Then you can have a lightweight text 
mode debugger in its own thread that can set breakpoints, step, maybe 
watch variables, maybe support keyboard breaks, etc.  You might have to 
be careful of the optimizer confusing things for your instrumentation, 
except for tail call optimization, which you should try hard to avoid 
breaking with your instrumentation.

If you do this debugger, you can put its control interface on a TCP port 
or socket, for debugging from another machine (which might be running a 
resource-intensive GUI front-end to the debugger), or for simply not 
messing up your stdio streams.

Neil V.


Posted on the users mailing list.