Stepping through a program

When a program is stopped, the step controls can be used to execute the program statement-by-statement. While performing a step operation, if a breakpoint or exception is encountered, execution suspends at the breakpoint or exception.

About this task

You can use step commands to step through your program a single statement at a time.

If you issue a step command while debugging a multithreaded application, execution may stop in a different thread.

Step Over

About this task

Issuing a step over allows one statement to execute. The current statement is executed without stopping in any program or procedure called within the statement (unless a breakpoint is hit) and execution suspends on the next executable statement. To execute a step over command:

Procedure

  1. If desired, select a call stack entry in the Debug view. The current line of execution in that call stack entry will be highlighted in the editor in the Debug perspective.
  2. Do one of the following:
    • Click the Step over button ( Step over icon) in the Debug view toolbar.
    • Select Run > Step Over from the workbench menu bar.
    • Press F6.

Step Into

About this task

With this action, you can step into code that has debug information and step over code that does not have debug information. This could be in the current program/procedure, in a called program/procedure, or in a program/procedure called within a called program/procedure.

To execute a step into command:

Procedure

  1. If desired, select a call stack entry in the Debug view. The current line of execution in that call stack entry will be highlighted in the Debugger editor in the Debug perspective.
  2. Do one of the following:
    1. Click the Step into button ( Step into icon) in the Debug view toolbar.
    2. Press F5.
  3. The current statement executes and the program stops at the next line encountered for which debug information is available.

Step Return

About this task

Issuing a step return allows all threads to run. To execute a step return command:

Procedure

  1. Select a call stack entry in the Debug view. This will cause the current line of execution in the selected frame to be highlighted in the editor.
  2. Do one of the following:
    1. Click the Step Return button ( Step return icon) in the Debug view toolbar.
    2. Select Run > Step Return from the workbench menu bar.
    3. Press F7.
  3. The current execution point, up to the line immediately following the line that called the function or program, is executed. Execution stops after exiting the current function or program. If you issue this command from a main entry point (that is, in main()), the program runs to completion.
    Restriction:
    • Step return is unavailable in releases prior to V5R3.
    • Step return is not supported for OPM (non-ILE) programs. If you attempt to step return from a non-ILE program, the debugger will remain at its current position and a message will open, indicating that the step return could not be issued.

Results

Note: Applies to Java When debugging your Java program, stepping behavior may be irregular when stepping into constructors, or when stepping into or over SystemLoad library functions.

Feedback