Getting started debugging a z/OS application with the debugger

The instructions in this topic help you get started debugging one of your z/OS applications.

About this task

The instructions describe how to choose a z/OS application for this task, set the daemon to the correct IP address and port number, verify that the daemon is listening, modify the correct options of TEST runtime parameter, start the application, and then complete a few simple debugging steps. After completing these steps, you can learn more about modifications you might need to make to these steps to debug other z/OS applications.

Procedure

Do the following steps to get started debugging an application on your z/OS system:

  1. Choose the application that you want to debug and that you know how to modify the TEST runtime parameter associated with this application.
    With z/OS Debugger, you can debug COBOL, PL/I, C/C++, and assembler (LE) programs running in IMS, CICS®, Db2® or z/OS UNIX System Services. The topic z/OS Debugger: overview in the IBM z/OS Debugger User's Guide gives a complete list of the types of programs you can debug with the debugger (known as remote debugger or remote debug mode in the IBM z/OS Debugger User's Guide) and the subsystems the debugger supports.
  2. If you are not using the Debug Manager to simplify remote debugging, obtain the IP address of your workstation.
    You can obtain the IP address by doing the following steps:
    1. Open a Command Prompt window and enter the command ipconfig.
      The window displays a list of IP addresses. The correct IP address is labeled IP address and is in the format www.xxx.yyy.zzz. If you see more than one IP address, one IP address might be for a network device, like a router or wireless hub, and the other is for your workstation. Use the IP address for your workstation. Make a note of this IP address.
    2. Enter the exit command to close the window.
  3. In the debugger, verify that the daemon is listening by doing the following steps:
    1. Click Window > Open perspective > Debug > OK.
    2. In the Debug view, locate the listener icon on the right side of the Debug view. The listener icon is green (Icon indicating that listening is on) if the listener daemon is on, red (Icon indicating that listening is off) if the listener daemon is off.
    3. If the icon is red, click the icon to turn on the listener daemon. The icon turns green.
  4. Modify the TEST runtime option for your application to replace the existing MFI or VTAM% option with the DBM (standard mode) or DBMDT (Debug Tool compatibility mode) option, or update the existing DIRECT& (standard mode) or TCPIP& (Debug Tool compatibility mode) option.

    If you are replacing an existing MFI or VTAM% option, remember that the format of the DIRECT& option is DIRECT&tcpip_id%port_id or TCPIP& option is TCPIP&tcpip_id%port_id, where you replace tcpip_id with the TCP/IP address you obtained from step 2. The default port ID is 8001; if the daemon shows a different port number, replace port_id with that port number.

    If you are updating an existing DIRECT& or TCPIP& option, verify that you specify the IP address you obtained from step 2. The default port ID is 8001; if the daemon shows a different port number, replace port_id with that port number.

    If you are using CADP for CICS programs, remember to set your display device correctly; in particular, set Session Type to TCP.

    If you are using DTCN for CICS programs, remember to set Session Type to TCP.

    If you are specifying the IP address for Db2 stored procedures, remember to follow the instructions in the topic Preparing a Db2 stored procedures program in IBM z/OS Debugger User's Guide.

    You can view examples how the TEST runtime option might change in What to do next .

  5. Start your application as you normally do when you are debugging it.
    Information pertaining to your application appears in the Debug view. If you do not see information about your application in the Debug view, check the following items:
    • If you are using DBM or DBMDT, verify that the Debug Manager is running on the host.
    • You obtained the correct IP address and port number for your workstation.
    • You specified the correct TEST runtime option, including the correct IP address and port number.
    • Verify that the daemon is listening.
  6. Step through your program, set a breakpoint, run your program to the breakpoint, and monitor a variable in your application.
    The following instructions show you how to do each of these tasks:
    • To step through your program, click on the Step into button (Icon for the Step into action).
    • To set a breakpoint, go to the debugger editor, right-click the statement on which you want to set a breakpoint and select Add breakpoint.
    • To run your program to a breakpoint that you set, click Resume Icon for the Resume action.
    • To monitor a variable, go to the debugger editor and right-click the variable you want to monitor. Select Monitor Expression from the pop-up menu.
  7. To end your debugging session, click on the Terminate button (Icon for the Terminate action) in the Debug view. This icon is located on the right side of the Debug view.

What to do next

To learn about debug features, see Overview of IBM z/OS Debugger.