Given that the trampoline is made explicit with #190, it should now be fairly easy to introduce a version that allows stepping through the continuations in the REPL.
A call to (breakpoint) will yield a marked resumable and cause the original trampoline to exit. That return is trapped by the debugger trampoline, which allows a step-by-step execution with REPL commands:
;step - executes the resumable once.
;step-over - executes the resumable until a new function call appears on the call trace*
;trace N - show the N most recent calls in the call trace
;run'- resumes with the usual trampoline
;back - resets the computation to the last breakpoint
;reset - resets the computation to beginning
For inspecting the stack-trace, a separate call-trace can be used - should store the active function frames in a ring buffer in debug-compiled code (#197).
REPL should also trap Racket execution breaks and treat these as breakpoints.
Given that the trampoline is made explicit with #190, it should now be fairly easy to introduce a version that allows stepping through the continuations in the REPL.
A call to
(breakpoint)
will yield a marked resumable and cause the original trampoline to exit. That return is trapped by the debugger trampoline, which allows a step-by-step execution with REPL commands:;step
- executes the resumable once.;step-over
- executes the resumable until a new function call appears on the call trace*;trace N
- show the N most recent calls in the call trace;run'
- resumes with the usual trampoline;back
- resets the computation to the last breakpoint;reset
- resets the computation to beginningFor inspecting the stack-trace, a separate call-trace can be used - should store the active function frames in a ring buffer in debug-compiled code (#197).
REPL should also trap Racket execution breaks and treat these as breakpoints.