Enterprise Developer offers some powerful tools to help you debug local and remote projects. It also supports debugging of standalone files which are not part of a project. This is a brief overview of how to prepare and debug an application.
Debugging applications that have a project
- Ensure that the current active
build configuration is compiling the project for debugging. See
Compile for Debugging.
- Compile the source code - by default, Eclipse compiles your projects automatically when the projects change.
If
Project > Build Automatically is turned off, to compile click
Project > Build Project.
- Choose or create a
debug configuration by clicking
. Different types of COBOL debug configurations are available for different types of debug sessions, where each type of configuration offers different options and requires different specifications. Like build configurations, you can have multiple debug configurations and swap between them. These settings override the project's run-time settings.
- Click
Debug.
Eclipse opens the Debug perspective that provides views that facilitate debugging.
- Use the options on the
Run menu to step through the program, stop at breakpoints and query data item values and so on.
See
Debugging Features and Techniques in Eclipse for tips on the commands and features that are available during debugging.
- To stop debugging, click
Run > Terminate.
- To return to either the COBOL or the Team Developer perspective, click
,
COBOL, or
,
Team Developer, at the top right of the Eclipse window.
Debugging standalone files
You can use the IDE to debug a standalone native COBOL program that is not a part of a project. The file must be compiled for debugging first to produce the information that the debugger requires.
To debug a standalone file:
- If necessary, compile the program in the IDE by right-clicking in the editor and clicking
Compile.
Eclipse either used the Compiler directives provided by the associated program symbols file (.idy) or, if no .idy file is present, uses the directives specified in
Window > Preferences > Micro Focus > COBOL > Standalone Files > Compile.
- Right-click the file in the editor and click
Debug As > COBOL Application.
This starts debugging and the IDE switches to the Debug perspective.
- Step through the program in the usual way.