Top-level CommandToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Significantly revised from 9.0.
9.0 version

:step

Arguments: &rest args

If not in ldb mode (ldb does not appear in the prompt), this command initiates or affects stepping, as we now describe. See below for behavior in ldb mode.

The :step top-level command implements the functionality of the step macro.

With an argument of t, stepping is enabled globally, otherwise the arguments are assumed to be symbols naming functions wherein stepping should occur. Any non-functions supplied to :step will be flagged as invalid arguments, but an error will not be signaled.

Called with no arguments or nil as an argument while not stepping, stepping is disabled. Use the command :sover to get out of stepping in order to turn stepping off. :step and :step nil have no effect while stepping is going on. It is only useful to step through compiled code. When you try to step through interpreted code, you end up stepping through the interpreter itself, with most output irrelevant to understanding your own code.

See also :sover and :scont.

The minimal abbreviation of :step is :st.

:step in ldb mode

When in ldb-step mode, the step command recognizes several sub-commands as its first argument:

Subcommand Action
:step cont [n] Continues through the current instruction (skipping n steps if n supplied, otherwise skipping one) even if there is a breakpoint in it.
:step over [slide-dir] Step over a function call. See below for the meaning of slide-dir. This command is sticky, which means calls just to :step after a call to :step over will be another similar call to :step over.
:step into [slide-dir] Step into a function call. A primcall (a call to a runtime system function) is never stepped into. See below for the meaning of slide-dir. This command is sticky, which means calls just to :step after a call to :step into will be another similar call to :step into.
:step - [slide-dir] Step as before but with a different slide-direction. See below for the meaning of slide-dir.
:step this No actual stepping is done, but the current instruction is re-printed in disassembled form.
:step return The currently-debugged function continues to its end, and the caller of the function is breakpointed just after the call (so step out to the caller of the current function).
:step type Prints information on what kind of stepping is being remembered for the <return> key. :none is printed until the first occurrence of either a :step over or :step into is done. See The Lisp DeBug (ldb) stepper in debugging.htm.

To step through only the top-level forms (i.e. un-macroexpanded) specify :step :over 0.

slide-direction

slide-dir is optional and directs the stepper how to deal with macroexpansions and forms. The choices are:

The default is :step :over :into which steps over function calls, but expands all macros within a function.

To use :step in ldb mode, you must be at a breakpoint. Thus:

cl-user(1): :ldb t
[ldb] cl-user(2): :step into
You must be stopped at a breakpoint before ldb-stepping can begin.
[ldb] cl-user(3):

When not at a function call point, over and into are equivalent. Typing return repeats the remembered previous command.

Example

cl-user(1): (declaim (optimize debug))
t
cl-user(2): (shell "cat times.cl")

(defun doit (n)
  (let ((res))
    (do ((i 0 (1+ i)))
	((= i n)
	 res)
      (push i res))))
0
cl-user(3): :cf times
;;; Compiling file times.cl
;;; Writing fasl file times.fasl
;;; Fasl write complete
cl-user(4): :ld times
; Fast loading /net/penn/acl/duane/acl91/src/times.fasl
cl-user(5): :br doit :pos 57
Adding #<Function doit>: 41
break: lev=0 pc=41 rec=11               form=(= i n)

in #P"times.cl" starting at 57 ending at 64.
Possible slide directions: (into out across back)
Current step/slide type: over/into
cl-user(6): :ldb t
[ldb] cl-user(7): (doit 10)

Hit breakpoint at func = #<Function doit>, pc=41
break: lev=0 pc=41 rec=11               form=(= i n)

in #P"times.cl" starting at 57 ending at 64.
Possible slide directions: (into out across back)
Current step/slide type: over/into
[ldb-step] cl-user(8): :loc
Compiled lexical environment:
0(Required): n: 10
12(Reg/%r13): res: nil
13(Reg/%r12): i: 0
14(Reg/%rdi): nil: 0
[ldb-step] cl-user(9): :br
#<Function doit>: lisp:rec=11 pc=41 pos=57:64 hit 1 time
                  
[ldb-step] cl-user(10): :step cont 2
Continuing past #<Lisp Bpt doit #11 pc: 41 @@57:64 lev: 0-2  @
                  #x10003a87e22> 2 times

Hit breakpoint at func = #<Function doit>, pc=41
break: lev=0 pc=41 rec=11               form=(= i n)

in #P"times.cl" starting at 57 ending at 64.
Possible slide directions: (into out across back)
Current step/slide type: over/into
[ldb-step] cl-user(11): :loc
Compiled lexical environment:
0(Required): n: 10
12(Reg/%r13): res: (1 0)
13(Reg/%r12): i: 2
14(Reg/%rdi): nil: 2
[ldb-step] cl-user(12): :br
#<Function doit>: lisp:rec=11 pc=41 pos=57:64 hit 3 times
                  
[ldb-step] cl-user(13): 

Note that the :step cont 2 command at prompt #10 causes the iteration to skip from i=0 to i=2.

Note that this transcript uses another undocumented command: the :pos keyword argument to the :break command.

See with-breakpoints-installed and the :break.

See The Lisp DeBug (ldb) stepper in debugging.htm for information on ldb stepping.

See top-level.htm for more information on top-level commands. See debugging.htm for information on the debugger and examples of stepping.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page has had significant revisions compared to the 9.0 page.
Created 2016.6.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Significantly revised from 9.0.
9.0 version