All Manuals > LispWorks IDE User Guide > 25 The Stepper

NextPrevUpTopContentsIndex

25.2 Simple examples

There are two ways to enter the Stepper tool:

25.2.1 Standalone use of the stepper

  1. Compile and load the demo system defined in the file
  2. (example-edit-file "tools/demo-defsys")

    First, load this file to define the system. Then evaluate in the Listener:

    (compile-system "demo" :load t)

    Note: for another way to compile and load a system, see The System Browser.

  3. Create a Stepper tool by choosing Window > Tools > Stepper or pressing in the LispWorks toolbar.
  4. Enter this form in the source area of the Stepper tool:
  5. (my-function 3)

  6. Choose the menu command Stepper > Step . The open parenthesis is highlighted orange, indicating that the next step is to evaluate the form.
  7. Choose Stepper > Step again. The symbol my-function is now highlighted orange, indicating that the next step is to call this function. Notice how the current stepping position is always highlighted orange.
  8. Notice how the topmost item in the Backtrace area always indicates the next step. Expand this item to show the arguments.
  9. Figure 25.2 Stepper backtrace showing the next step

  10. At this point we have the option to step my-function itself, but for the moment simply choose Stepper > Step again, which steps to the point where the function call returns. The Backtrace area shows the return value, 12, when you expand the status item.

Note how the Step command always steps only inside the current form, and does not step into other functions.

25.2.2 Invoking the Stepper via a breakpoint

  1. Compile and load the code in the system demo defined in the file
  2. (example-edit-file "tools/demo-defsys")

  3. Open the file
  4. (example-edit-file "tools/demo-utils")

    in an Editor and set a breakpoint at the call to + as described in Setting breakpoints.

  5. Evaluate (my-useful-function 42) in a Listener.
  6. A Stepper tool appears, with the current stepping position at the breakpoint.
  7. Figure 25.3 Stepper invoked by reaching a breakpoint

  8. You can now step this code, just as in standalone mode.
  9. When you choose Stepper > Continue , or otherwise finish stepping, my-useful-function returns, the Stepper is hidden and the Listener tool becomes active again.

LispWorks IDE User Guide (Macintosh version) - 13 Sep 2017

NextPrevUpTopContentsIndex