From: ·············@gmail.com
Subject: How to "single-step" in slime+emacs
Date: 
Message-ID: <3d00abd2-c2eb-444c-b2a2-6a941bc1aefc@c58g2000hsc.googlegroups.com>
Hello,

(using :editor emacs :editor-package slime :lisp sbcl :platform
linux).
(Consider :following-code)


(declaim (optimize (safety 3)) (optimize (debug 3)) (optimize (speed
0)))

(defun callee (arg1 arg2 arg3)
  (let ((combo (+ arg1 arg2 arg3)))
    (break "first")
    (sin (* pi combo))
    (break "second ~f" combo)))

(defun caller ()
  (callee 1 2 3))

(sheepishly), $B!!(BHow can I step from caller into callee?  I've been
trying to figure it out and read up on it, but to no avail.

$B!J(BThe break statements are from other experiments that eliminated some
other silly questions)

Thank you,

Mirko

From: Pascal J. Bourguignon
Subject: Re: How to "single-step" in slime+emacs
Date: 
Message-ID: <7cskw2ea07.fsf@pbourguignon.anevia.com>
·············@gmail.com writes:

> Hello,
>
> (using :editor emacs :editor-package slime :lisp sbcl :platform
> linux).
> (Consider :following-code)
>
>
> (declaim (optimize (safety 3)) (optimize (debug 3)) (optimize (speed
> 0)))
>
> (defun callee (arg1 arg2 arg3)
>   (let ((combo (+ arg1 arg2 arg3)))
>     (break "first")
>     (sin (* pi combo))
>     (break "second ~f" combo)))
>
> (defun caller ()
>   (callee 1 2 3))
>
> (sheepishly),  How can I step from caller into callee?  I've been
> trying to figure it out and read up on it, but to no avail.

First you'd use STEP :

   (step (caller))

then, using the native debugger, you'd step "in", instead of stepping
"over".  In clisp that'd be:  step  or  :s

Yep, it looks like it's not possible to do it in slime, from the
documentation of sldb at:
http://common-lisp.net/project/slime/doc/html/Miscellaneous.html#Miscellaneous

-- 
__Pascal Bourguignon__
From: Peter Hildebrandt
Subject: Re: How to "single-step" in slime+emacs
Date: 
Message-ID: <483d799e$0$90262$14726298@news.sunsite.dk>
Pascal J. Bourguignon wrote:

> Yep, it looks like it's not possible to do it in slime, from the
> documentation of sldb at:
> http://common-lisp.net/project/slime/doc/html/Miscellaneous.html#Miscellaneous

???

(defun myfn () (print 'hallo))
(step (myfn))

--->

Evaluating call:
   (MYFN)
With arguments:


    [Condition of type SB-EXT: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 SLIME's top level.
  5: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" 
{B15B4C9}>)

Backtrace:
   0: (NIL)
   1: (SB-INT:SIMPLE-EVAL-IN-LEXENV
       (LET ((SB-IMPL::*STEP-OUT* :MAYBE))
         (UNWIND-PROTECT (SB-IMPL::WITH-STEPPING-ENABLED #)))
       #S(SB-KERNEL:LEXENV
          :FUNS NIL
          :VARS NIL
          :BLOCKS NIL
          :TAGS NIL
          :TYPE-RESTRICTIONS NIL
          :LAMBDA NIL ..))
From: Pascal J. Bourguignon
Subject: Re: How to "single-step" in slime+emacs
Date: 
Message-ID: <7cfxs2e72s.fsf@pbourguignon.anevia.com>
Peter Hildebrandt <·················@gmail.com> writes:

> Pascal J. Bourguignon wrote:
>
>> Yep, it looks like it's not possible to do it in slime, from the
>> documentation of sldb at:
>> http://common-lisp.net/project/slime/doc/html/Miscellaneous.html#Miscellaneous
>
> ???
>
> (defun myfn () (print 'hallo))
> (step (myfn))
>
> --->
>
> Evaluating call:
>   (MYFN)
> With arguments:
>
>
>    [Condition of type SB-EXT:STEP-FORM-CONDITION]
>
> Restarts:
>  0: [STEP-CONTINUE] Resume normal execution

With clisp, and the version of slime I have here, it doesn't work.
Granted, it's rather "old"...  I'll have to update it.

-- 
__Pascal Bourguignon__
From: Juho Snellman
Subject: Re: How to "single-step" in slime+emacs
Date: 
Message-ID: <871w3mwie0.fsf@vasara.proghammer.com>
·············@gmail.com writes:

> Hello,
> 
> (using :editor emacs :editor-package slime :lisp sbcl :platform
> linux).
> (Consider :following-code)
> 
> 
> (declaim (optimize (safety 3)) (optimize (debug 3)) (optimize (speed
> 0)))
> 
> (defun callee (arg1 arg2 arg3)
>   (let ((combo (+ arg1 arg2 arg3)))
>     (break "first")
>     (sin (* pi combo))
>     (break "second ~f" combo)))
> 
> (defun caller ()
>   (callee 1 2 3))
> 
> (sheepishly), ��How can I step from caller into callee?  I've been
> trying to figure it out and read up on it, but to no avail.

First ensure that you enter the debugger when calling CALLER. For
example by doing (trace caller :break t), or by adding an explicit
BREAK into the source code.

Once in the debugger, press "s" to enter the stepper. From there you
can use "s" to step into the call, "x" to step over the call, or "o"
to step out of the function that's currently being executed.

-- 
Juho Snellman
From: ·············@gmail.com
Subject: Re: How to "single-step" in slime+emacs
Date: 
Message-ID: <0da131d9-e33b-4acf-b4d2-97c316bbb648@r66g2000hsg.googlegroups.com>
On May 28, 11:36 am, Juho Snellman <······@iki.fi> wrote:
> ·············@gmail.com writes:
> > Hello,
>
> > (using :editor emacs :editor-package slime :lisp sbcl :platform
> > linux).
> > (Consider :following-code)
>
> > (declaim (optimize (safety 3)) (optimize (debug 3)) (optimize (speed
> > 0)))
>
> > (defun callee (arg1 arg2 arg3)
> >   (let ((combo (+ arg1 arg2 arg3)))
> >     (break "first")
> >     (sin (* pi combo))
> >     (break "second ~f" combo)))
>
> > (defun caller ()
> >   (callee 1 2 3))
>
> > (sheepishly), $B!!(BHow can I step from caller into callee?  I've been
> > trying to figure it out and read up on it, but to no avail.
>
> First ensure that you enter the debugger when calling CALLER. For
> example by doing (trace caller :break t), or by adding an explicit
> BREAK into the source code.
>
> Once in the debugger, press "s" to enter the stepper. From there you
> can use "s" to step into the call, "x" to step over the call, or "o"
> to step out of the function that's currently being executed.
>
> --
> Juho Snellman

I get an error when I try to use "s", "x", or "o".  The last two are
not assigned to any emacs commands, while pressing "s" results in

No continue restart.
   [Condition of type SIMPLE-ERROR]

Restarts:
  0: [ABORT] Return to sldb level 1.
  1: [ABORT-REQUEST] Abort handling SLIME request.
  2: [ABORT] Exit debugger, returning to top level.


I may need to update my slime setup.

Thank you to all of you.  This will make life much simpler.

Mirko
From: Peter Hildebrandt
Subject: Re: How to "single-step" in slime+emacs
Date: 
Message-ID: <483dc084$0$90273$14726298@news.sunsite.dk>
·············@gmail.com wrote:
> On May 28, 11:36 am, Juho Snellman <······@iki.fi> wrote:
  trying to figure it out and read up on it, but to no avail.
>> First ensure that you enter the debugger when calling CALLER. For
>> example by doing (trace caller :break t), or by adding an explicit
>> BREAK into the source code.
>>
>> Once in the debugger, press "s" to enter the stepper. From there you
>> can use "s" to step into the call, "x" to step over the call, or "o"
>> to step out of the function that's currently being executed.

I believe these are the bindings when using SBCL directly.

When using slime, the key bindings are different, eg.

  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

This is with SBCL 1.0.11 and a SLIME from CVS.from some time mid 2007.

Peter

>> --
>> Juho Snellman
> 
> I get an error when I try to use "s", "x", or "o".  The last two are
> not assigned to any emacs commands, while pressing "s" results in
> 
> No continue restart.
>    [Condition of type SIMPLE-ERROR]
> 
> Restarts:
>   0: [ABORT] Return to sldb level 1.
>   1: [ABORT-REQUEST] Abort handling SLIME request.
>   2: [ABORT] Exit debugger, returning to top level.
> 
> 
> I may need to update my slime setup.
> 
> Thank you to all of you.  This will make life much simpler.
> 
> Mirko
From: Juho Snellman
Subject: Re: How to "single-step" in slime+emacs
Date: 
Message-ID: <87tzgiuofz.fsf@vasara.proghammer.com>
Peter Hildebrandt <·················@gmail.com> writes:

> ·············@gmail.com wrote:
> > On May 28, 11:36 am, Juho Snellman <······@iki.fi> wrote:
>   trying to figure it out and read up on it, but to no avail.
> >> First ensure that you enter the debugger when calling CALLER. For
> >> example by doing (trace caller :break t), or by adding an explicit
> >> BREAK into the source code.
> >>
> >> Once in the debugger, press "s" to enter the stepper. From there you
> >> can use "s" to step into the call, "x" to step over the call, or "o"
> >> to step out of the function that's currently being executed.
> 
> I believe these are the bindings when using SBCL directly.

I believe that you're not right about that, as SBCL has no
"keybindings". And those are the keybindings I added into Slime. It's
of course possible that somebody has removed them in the last couple
of years.

> When using slime, the key bindings are different, eg.
>
>   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
> 
> This is with SBCL 1.0.11 and a SLIME from CVS.from some time mid 2007.

Those aren't keybindings, that's a restart menu (SBCL communicates
with the stepper, whether the one in Slime or the SBCL debugger, via
conditions and restarts). You can of course use the restarts directly
if you insist, rather than using the commands I listed. There are
however a number of downsides to using the restarts:

  * They might move around, if eg. the SBCL stepper is changed, which
    would be bad if you've gotten into a habit of pressing eg. "3"
    instead of "s".
  * They would obviously not be available at all on Lisp
    implementations where the stepper doesn't use conditions. This
    doesn't matter too much, since most other lisps don't have 
    single stepping support in Slime.

-- 
Juho Snellman
From: Peter Hildebrandt
Subject: Re: How to "single-step" in slime+emacs
Date: 
Message-ID: <483dd4a7$0$90273$14726298@news.sunsite.dk>
Juho Snellman wrote:
> Peter Hildebrandt <·················@gmail.com> writes:
>>>> Once in the debugger, press "s" to enter the stepper. From there you
>>>> can use "s" to step into the call, "x" to step over the call, or "o"
>>>> to step out of the function that's currently being executed.
>> I believe these are the bindings when using SBCL directly.
> 
> I believe that you're not right about that, as SBCL has no
> "keybindings". And those are the keybindings I added into Slime. It's
> of course possible that somebody has removed them in the last couple
> of years.

I believe you have a point here :-)

To the OP:   It looks like the point has to be on a form in the stack 
trace when using s, o, or x, so they work much like r, but keep 
stepping.  So telling from the error message you got, you probably had 
not moved the point into the debugger window and on a form from the 
stack trace.

HTH,
Peter

>> When using slime, the key bindings are different, eg.
>>
>>   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
>>
>> This is with SBCL 1.0.11 and a SLIME from CVS.from some time mid 2007.
> 
> Those aren't keybindings, that's a restart menu (SBCL communicates
> with the stepper, whether the one in Slime or the SBCL debugger, via
> conditions and restarts). You can of course use the restarts directly
> if you insist, rather than using the commands I listed. There are
> however a number of downsides to using the restarts:
> 
>   * They might move around, if eg. the SBCL stepper is changed, which
>     would be bad if you've gotten into a habit of pressing eg. "3"
>     instead of "s".
>   * They would obviously not be available at all on Lisp
>     implementations where the stepper doesn't use conditions. This
>     doesn't matter too much, since most other lisps don't have 
>     single stepping support in Slime.
>