There are several debug options and configurations. In the following steps, you create a local debug session.
-
Select your project in the
Application Explorer view, open
COBOL Programs, and then double-click
tictac.cbl.
The COBOL program is opened in the editor.
-
In the source code, locate 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. Press
Ctrl+S to save.
-
From the main menu, click
.
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.
-
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).
-
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.exe (Windows) or
New_Configuration.bin/tictac (UNIX)"
|
-
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.
-
Click
Resume: 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.
-
To stop debugging, click
Terminate. Alternatively, press
Ctrl+F2.
-
To change back to the
Team Developer perspective, click the icon for the
Team Developer in the top right corner.