I have checked in changes that implement this for openmcl.
sldb-return-from-frame: "reads an expression in the minibuffer and causes the function to return that value, evaluated in the context of the frame"
sldb-restart-frame: "causes the frame to restart execution with the same arguments as it was called originally"
You can use these functions in an sldb buffer with cursor on the frame you want to restart or return from.
Does this functionality exist in other lisps?
Also checked in implementation of frame-catch-tags for openmcl
-Alan
Alan Ruttenberg alanralanr@comcast.net writes:
I have checked in changes that implement this for openmcl.
sldb-return-from-frame: "reads an expression in the minibuffer and causes the function to return that value, evaluated in the context of the frame"
sldb-restart-frame: "causes the frame to restart execution with the same arguments as it was called originally"
You can use these functions in an sldb buffer with cursor on the frame you want to restart or return from.
Very nice!
Does this functionality exist in other lisps?
I'm pretty sure "return-from-frame" exists in SBCL, Allgero, Lispworks, and CLISP. It's not implemented in CMUCL/x86, but that would be a interesting exercise. "restart-frame" probably works only on certain frames, but is definitely a useful command.
Helmut.
Alan Ruttenberg alanralanr@comcast.net writes:
sldb-return-from-frame: "reads an expression in the minibuffer and causes the function to return that value, evaluated in the context of the frame"
sldb-restart-frame: "causes the frame to restart execution with the same arguments as it was called originally"
You can use these functions in an sldb buffer with cursor on the frame you want to restart or return from.
Does this functionality exist in other lisps?
CLISP has (SYS::RETURN-FROM-EVAL-FRAME framepointer form)
which unwinds to the EVAL/APPLY frame given by FRAMEPOINTER and returns as values of this frame the values of evaluating FORM (translated from the German comment in src/debug.d).
So it might be enough to do
(defslimefun sldb-return-from-frame (form index) (sys::return-from-eval-frame (nth-frame index) (from-string form)))
The corresponding function in the native break loop is debug-return (in src/reploop.lisp).
Similarly, CLISP has (SYS::REDO-EVAL-FRAME framepointer), which unwinds to the EVAL/APPLY frame given by FRAMEPOINTER and reprocesses it (from src/debug.d).
Wolfgang