Lisp HUG Maillist Archive

Question about stepper and LABELS

Hi

I have noticed that in the stepper, LABELS seem to be elided.

E.g.

(defun foo (x)
   (labels ((zot (x y)
               (+ x y) ; Let’s add a break here!
               ))
      (zot x 42)))


Is there any incantation I can make to have the stepper show me the LABELS frames?  I believe I remember something like that.  
I am using 7.1.

Thanks



--
Marco Antoniotti


Re: Question about stepper and LABELS



On 29 Nov 2017, at 13:08, Marco Antoniotti <marcoxa@cs.nyu.edu> wrote:

Hi

I have noticed that in the stepper, LABELS seem to be elided.

E.g.

(defun foo (x)
   (labels ((zot (x y)
               (+ x y) ; Let’s add a break here!
               ))
      (zot x 42)))


Is there any incantation I can make to have the stepper show me the LABELS frames?  I believe I remember something like that.  
I am using 7.1.

In the meantime, you may use com.informatimago.common-lisp.lisp.stepper
It’s not a debugger (yet), so you cannot just specify a breakpoint (without modifying the source), but you can trace, and step to it.
(You could force stepping by explicitly setting:
(setf com.informatimago.common-lisp.lisp.stepper.internal:*step-mode* :step)
)

cl-user> (mkupack :name :marco :stepper t)
#<Package "MARCO">
marco> (defun foo (x)
         (labels ((zot (x y)
                    (+ x y) ; Let’s add a break here!
                    ))
           (zot x 42)))

foo
marco> (step (foo 3) :trace)
(Will evaluate (foo 3)
 (Entering function foo
   (Bind x                to 3)
  (Will evaluate (labels ((zot # #)) (zot x 42))
   (Will evaluate (zot x 42)
    (x ==> 3)
    (Entering function zot
      (Bind x                to 3)
      (Bind y                to 42)
     (Will evaluate (+ x y)
      (x ==> 3)
      (y ==> 42)
      Evaluation of (+ x y) returned one result ==> 45)
     Exiting  function zot returned one result ==> 45)
    Evaluation of (zot x 42) returned one result ==> 45)
   Evaluation of (labels ((zot # #)) (zot x 42)) returned one result ==> 45)
  Exiting  function foo returned one result ==> 45)
 Evaluation of (foo 3) returned one result ==> 45)
45
marco> (step (foo 3) :step)
(Will evaluate (foo 3)
 Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?si
Will evaluate (foo 3)
 (Will evaluate 3
  Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?s

  (--> 3))
 (Entering function foo
   (Bind x                to 3)
  Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?si

  (Will evaluate (labels ((zot # #)) (zot x 42))
   Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?si
Will evaluate (labels ((zot # #)) (zot x 42))
   (Will evaluate (zot x 42)
    Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?si
Will evaluate (zot x 42)
    (Will evaluate x
     Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?s

     (x ==> 3))
    (Will evaluate 42
     Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?s

     (--> 42))
    (Entering function zot
      (Bind x                to 3)
      (Bind y                to 42)
     Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?si

     (Will evaluate (+ x y)
      Step Into (s, si, RET), Step over (so), Trace (t), Function (f), Run (r), List (l), Eval (e), Debugger (d), Abort (a, q)?r
))
    Evaluation of (zot x 42) returned one result ==> 45)
   Evaluation of (labels ((zot # #)) (zot x 42)) returned one result ==> 45))
 Evaluation of (foo 3) returned one result ==> 45)
45
marco> 

Updated at: 2020-12-10 08:30 UTC