ILE COBOL Programmer's Guide

Stepping Through the Program Object or ILE Procedure

After a breakpoint is encountered, you can run a specified number of statements of a program object or ILE procedure, then stop the program again and return to the Display Module Source display. The program object or ILE procedure begins running on the next statement of the module object in which the program stopped.

You can step into an OPM program if it has debug data available, and if the debug session accepts OPM programs for debugging.

You can step through a program object or ILE procedure by using:

The simplest way to step through a program object or ILE procedure one statement at a time is to use F10 (Step) or F22 (Step into) on the Display Module Source display. When you press F10 (Step) or F22 (Step into), the next statement of the module object shown in the Display Module Source display is run, and the program object or ILE procedure is stopped again. If multiple statements are contained in a line on which F10 (Step) or F22 (Step into) is pressed, all of the statements on that line are run and the program object or ILE procedure is stopped at the next statement on the next line.

Note:
You cannot specify the number of statements to step through when you use F10 (Step) or F22 (Step into). Pressing F10 (Step) or F22 (Step into) performs a single step.

Another way to step through a program object or ILE procedure is to use the STEP debug command. The STEP debug command allows you to run more than one statement in a single step. The default number of statements to run, using the STEP debug command, is one. To step through a program object or ILE procedure using the STEP debug command, type:

STEP number-of-statements

on the debug command line. number-of-statements is the number of statements that you want to run in the next step before the application is halted again. For example, if you type

STEP 5

on the debug command line, the next five statements of your program object or ILE procedure are run, then the program object or ILE procedure is stopped again and the Display Module Source display is shown.

When a CALL statement to another program object or ILE procedure is encountered in a debug session, you can:

If you choose to step over the called program object or ILE procedure then the CALL statement and the called program object are run as a single step. The called program object or ILE procedure is run to completion before the calling program object or ILE procedure is stopped at the next step. Step over is the default step mode.

If you choose to step into the called program object or ILE procedure then each statement in the called program object or ILE procedure is run as a single step. If the next step at which the running program object or ILE procedure is to stop falls within the called program object or ILE procedure then the called program object or ILE procedure is halted at this point and the called program object or ILE procedure is shown in the Display Module Source display.

Stepping Over Program Objects or ILE Procedures

You can step over program objects or ILE procedures by using:

You can use F10 (Step) on the Display Module Source display to step over a called program object or ILE procedure in a debug session. If the next statement to be run is a CALL statement to another program object or ILE procedure, then pressing F10 (Step) will cause the called program object or ILE procedure to run to completion before the calling program object or ILE procedure is stopped again.

Alternately, you can use the STEP OVER debug command to step over a called program object or ILE procedure in a debug session. To use the STEP OVER debug command, type:

STEP number-of-statements OVER

on the debug command line. number-of-statements is the number of statements that you want to run in the next step before the application is halted again. If one of the statements that are run contains a CALL statement to another program object or ILE procedure, the ILE source debugger will step over the called program object or ILE procedure.

Stepping Into Program Objects or ILE Procedures

You can step into program objects or ILE procedure by using:

You can use F22 (Step into) on the Display Module Source display to step into a called program object or ILE procedure in a debug session. If the next statement to be run is a CALL statement to another program object or ILE procedure then pressing F22 (Step into) will cause the first executable statement in the called program object or ILE procedure to be run. The called program object or ILE procedure will then be shown in the Display Module Source display.

Note:
A called ILE program object or procedure must have debug data associated with it, in order for it to be shown in the Display Module Source display. A called OPM program object will be shown in the Display Module Source display if the ILE source debugger is set up to accept OPM programs, and the OPM program has debug data. (An OPM program has debug data if it was compiled with OPTION(*SRCDBG) or OPTION(*LSTDBG).)

Alternately, you can use the STEP INTO debug command to step into a called program object or ILE procedure in a debug session. To use the STEP INTO debug command, type:

STEP number-of-statements INTO

on the debug command line. number-of-statements is the number of statements of the program object or ILE procedure that you want to run in the next step before the program object or ILE procedure is halted again. If one of the statements that are run contains a CALL statement to another program object or ILE procedure, the debugger will step into the called program object or ILE procedure. Each statement in the called program object or ILE procedure will be counted in the step. If the step ends in the called program object or ILE procedure then the called program object or ILE procedure will then be shown in the Display Module Source display. For example, if you type

STEP 5 INTO

on the debug command line, the next five statements of the program object or ILE procedure are run. If the third statement is a CALL statement to another program object or ILE procedure then two statements of the calling program object or ILE procedure are run and the first three statements of the called program object or ILE procedure are run.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]