Stepping through or running your program

By default, when z/OS® Debugger starts, none of your program has run yet (including C++ constructors and static object initialization).

z/OS Debugger defines a line as one line on the screen, commonly identified by a line number. A statement is a language construct that represents a step in a sequence of actions or a set of declarations. A statement can equal one line, it can span several lines, or there can be several statements on one line. The number of statements that z/OS Debugger runs when you step through your program depends on where hooks are placed.

To run your program up to the next hook, press PF2 (STEP). If you compiled your program with a combination of any of the following TEST or DEBUG compiler suboptions, STEP performs one statement:

  • For C, compile with TEST(ALL) or DEBUG(HOOK(LINE,NOBLOCK,PATH)).
  • For C++, compile with TEST or DEBUG(HOOK(LINE,NOBLOCK,PATH)).
  • For any release of Enterprise COBOL for z/OS, Version 3, or Enterprise COBOL for z/OS and OS/390®, Version 2, compile with one of the following suboptions:
    • TEST(ALL)
    • TEST(NONE) and use the Dynamic Debug facility
  • For Enterprise COBOL for z/OS, Version 4, compile with one of the following suboptions:
    • TEST(HOOK)
    • TEST(NOHOOK) and use the Dynamic Debug facility
  • For any release of Enterprise PL/I for z/OS, compile with TEST(ALL).
  • For Enterprise PL/I for z/OS, Version 3.4 or later, compile with TEST(ALL,NOHOOK) and use the Dynamic Debug facility.

To run your program until a breakpoint is reached, the program ends, or a condition is raised, press PF9 (GO).

Note: A condition being raised is determined by the setting of the TEST run-time suboption test_level.

The command STEP OVER runs the called function without stepping into it. If you accidentally step into a function when you meant to step over it, issue the STEP RETURN command that steps to the return point (just after the call point).

Refer to the following topics for more information related to the material discussed in this topic.