Previous Topic Next topic Print topic


Launch a Debug Session

There are several debug options and configurations. In the following steps, you create a local debug session.
  1. Highlight your project in the COBOL Explorer view and from the main menu click Run > Debug Configurations

    The Debug Configurations dialog is displayed.

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

    A Confirm Perspective Switch dialog box is displayed. Click Yes.

    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. You can set breakpoints by double-clicking in the margin at the far left of the source view and then run the program to the breakpoint by clicking Run > Resume.

    Tip: Use the following techniques to help you debug programs:
    Keyboard shortcuts
    • F5 = Step into the next statement at the current line of code and suspend execution. Equivalent of clicking .
    • F6 = Step over the next statement at the currently executing line of code without entering it, and suspend execution. The method will be executed normally. Equivalent of clicking .
    • F7 = Return from a method or paragraph that has been stepped into, and suspend execution. The remainder of the code inside the method is executed normally. Equivalent of clicking .
    • F8 = Resume execution of the program from a suspended line of code. Equivalent of clicking .
    You can also click the Drop to Frame button to reposition you at the start of the current method.
    To query the value of a data item or the file status of an internal file name
    Hold the mouse pointer over a data item or internal file name and the current value or file status displays as a Text Hover. The values of variables and file statuses of internal file names contained on the current execution line and previous line are displayed in Variables View (usually displayed in the top right of the IDE).
    To deal with unassigned linkage items

    If the debugger steps on a line with an unassigned linkage item (for example, if you are debugging only a part of your application and no memory has been allocated to that linkage item), debugging terminates. To assign linkage to that data item and continue debugging, you need to select the data item, right-click it and click Inspect COBOL. When prompted, confirm and assign a value to the data item. Alternatively, to assign linkage, you can right-click the data item in the Variables view and click Change Value.

Previous Topic Next topic Print topic