Applications you create with Eclipse need a launch configuration to execute. A launch configuration describes the way an application should be run or debugged.
Some launch configurations apply to running and debugging, while some apply only to debugging. It is possible to configure multiple launch configurations of the same, or different types, and you can give them meaningful names.
You create configurations by clicking Run > Run Configurations or Debug > Debug Configurations - the dialog box that these open enables you to manage the launch configurations. Click a type of configuration in the pane on the left-hand side of the dialog box - a description of the intended usage of the type is shown in the banner at the top.
Debugging your program opens the Debug perspective. You can step through code in the Debug view or use the Run to cursor feature to run from the current execution point to where you have placed the cursor.
The IDE offers a flexible debugging environment. When you debug the code you can step through it so that each line of the source is highlighted in turn as each statement is executed, showing the effect of each statement. You can interrupt execution to examine and change data items.
You can set breakpoints to control the way The following breakpoint are available:
Note that since execution breaks when the item has been changed, the cursor position will be on the statement after the statement that caused the data item to change value.
The Debug perspective comes with a number of views tailored to support the debugging process:
A number of debugger functions are sensitive to the item that is selected in the Debug view (so as to cope with different scopes for variables, and the debugging of multiple threads), so if a function that you expect to be enabled is not, check which item is selected in the view. If you want to step, you need to have selected the first code line within the thread.
Selecting different stack frames controls which variables are shown in the variables view, and also switches the editor to the relevant line of code.
The Memory view shows the memory at any given address. Note that the Memory view is not shown by default. To display it, click Window > Show View > Other and type Memory to locate the view.
You can directly enter a numerical address or the name of a pointer variable. Alternatively, you can enter the name of a non-pointer variable and the memory of that variable is shown. Both ASCII and EBCDIC renderings are available for the memory along with the default hexadecimal rendering - click the New Renderings tab in the toolbar of the view to add new rendering.
There are various ways in which you can debug an application depending on its type and whether it resides on the local or a remote machine. See Debugging COBOL applications in your product help for detailed explanation of the different debugging scenarios.
Now that you have read this brief introduction into running and debugging applications, practice what you've learned with the tutorial that follows, Debugging the Hello COBOL World Application.