I am trying to figure out how to step through code in sbcl and Slime after invoking the debugger with something like break. I do not want to have to start stepping from the beginning. For example if I have the following code:
(defun fib (n)
(when (eql n 2)
(break))
(if (<= 0 n 1)
n
(+ (fib (- n 1))
(fib (- n 2)))))
After the break point is hit, I want to be able to start stepping through the code. The only way I have found to do this, is to go over the frame in Slime, use the "Return From Frame" (R) feature, and type in (step (fib 2)).
When I try to use the "Step" (s) feature, instead of actually stepping, I am given this:
Evaluating call:
(CONTINUE)
With arguments:
[Condition of type STEP-FORM-CONDITION]
Restarts:
0: [STEP-CONTINUE] Resume normal execution
1: [STEP-OUT] Resume stepping after returning from this function
2: [STEP-NEXT] Step over call
3: [STEP-INTO] Step into call
4: [ABORT] Return to sldb level 1.
5: [CONTINUE] Return from BREAK.
--more--
Backtrace:
0: (SWANK:SLDB-STEP 0)
1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:SLDB-STEP 0) #<NULL-LEXENV>)
2: (EVAL (SWANK:SLDB-STEP 0))
3: (SWANK:EVAL-FOR-EMACS (SWANK:SLDB-STEP 0) "COMMON-LISP-USER" 122)
4: ((FLET #:FORM-FUN-7055 :IN SWANK::SLDB-LOOP))
5: (SWANK::SLDB-LOOP 1)
6: ((LAMBDA NIL :IN SWANK::DEBUG-IN-EMACS))
7: ((FLET SWANK/BACKEND:CALL-WITH-DEBUGGING-ENVIRONMENT :IN "/home/michael/slime/swank/sbcl.lisp") #<FUNCTION (LAMBDA NIL :IN SWANK::DEBUG-IN-EMACS) {1003DB44CB}>)
What I am looking for should be possible. From the sbcl manual stepping
can be invoked via the
step
macro, or from within the debugger.
I am running sbcl 1.2.5 with Slime 2.12 and my optimization qualities are all 1 except for safety and debug which are both 3.