Stepping through a program

When a thread is suspended, the step controls can be used to step through the execution of the program line-by-line.

While performing a step operation, if a breakpoint or exception is encountered, execution suspends at the breakpoint or exception, and the step operation ends.

Step Over

To execute a step over command:

  1. Select the thread that you want to step in the Debug view.
  2. Perform one of the following tasks:
    • Click the Step Over button (Step Over button) in the Debug view toolbar.
    • Select Run > Step Over from the workbench menu bar.
  3. The currently-selected line is executed and execution suspends on the next executable line.

If you have set node-by-node stepping on in the debugger preferences, the step over action will step node-by-node rather than line-by-line.

Note:
  • If you step over a for-each statement, a new stack frame will be added because the context changes in a for-each loop.
  • If you step over the last line of a template rule, the debugger will either stop at the template rule that matches the next element in the current context or will return to the calling template rule if all of the elements in the context have been processed.

Step Into

To execute a step into command:

  1. Select the thread that you want to step in the Debug view.
  2. Perform one of the following tasks:
    • Click the Step Into button (Step Into button) in the Debug view toolbar.
    • Select Run > Step Into from the workbench menu bar.
  3. If the current line is a simple statement, this command executes the statement. If the current line contains an xsl:apply-templates, xsl:call-template, or an extension function call, this command steps into the appropriate template rule or function.

Step Return

To execute a step return command:

  1. Select the thread that you want to step in the Debug view.
  2. Perform one of the following tasks:
    • Click the Step Return button (Step Return button) in the Debug view toolbar.
    • Select Run > Step Return from the workbench menu bar.
  3. Instructions are executed until the current stack frame is popped from the stack. Execution stops in the previous stack frame just after the xsl:apply-templates, xsl:call-template, or extension function call. If you issue this command from the first template rule, the transformation runs to completion.
Note: When inside a for-each loop, a step return will step out two stack frames instead of one.

Run to Line

When a thread is suspended, it is possible to resume execution until a specified line is executed. This is a convenient way to suspend execution at a line without setting a breakpoint.

  1. In the editor, place your cursor on the line to which you want the program to run and select Run to Line from the pop-up menu.
  2. Program execution is resumed and suspends just before the specified line is to be executed.

Feedback