Launch a Debug Session

There are several debug options and configurations. In the following steps, you create a local debug session.
  1. Select your project in the Application Explorer view, and then double-click tictac.cbl. The COBOL program is opened in the editor.
  2. In the source code, locate the first occurrence of the line perform get-reply, and then double-click in the far column to the left of the code: this should place a in the column to indicate a breakpoint.
  3. From the main menu, click Run > Debug Configurations .

    This starts the Debug Configurations dialog box and selects the run configuration you created before. You can use this configuration, but we are going to create a new one especially for debugging.

  4. Create a new debug configuration. You can do this in two ways:
    • Double-click the COBOL Application tree item, or
    • Click the COBOL Application tree item, and then click New launch configuration (New launch configuration).
  5. Ensure that settings for your configuration match these:
    Field Value
    Name "tictac_debug"
    COBOL Project "tictac"
    Program is part of project build configuration Selected, and with a value of "New Configuration"
    Main program or executable to debug "New_Configuration.bin/tictac"
  6. Click Debug.

    By default, a Confirm Perspective Switch dialog box is displayed. This is because Eclipse offers a different perspective for debugging that has views that provide relevant information that you might need. Click Switch to confirm the switch and start debugging.

    Some of the views that you see in this perspective are:

    • The Debug view shows the threads that are running in the application. For each thread, the status execution positions are shown. In addition, an application window opens where the specific steps in your application will be displayed as debugging takes place.
    • The Variables view displays data items and internal file names that are referenced on the current line and in the previous stepped statement. This allows you to view the before and after values or statuses of a particular item.
  7. Click Resume or press F8: the code runs, stopping at the line at which you set the breakpoint. Use the other debug options to step through the code.

    For more information on debugging your application, see Debugging Features and Techniques in Eclipse.

  8. To stop debugging, click Terminate. Alternatively, press Ctrl+F2.
  9. To change back to the Team Developer perspective, click the icon for the Team Developer in the top right corner.