Debug the Application

To be able to debug your application program, you need to ensure the project is compiled for debugging. You then need to create a debug configuration suitable for your application and use it to start a debug session.
  1. Click your project in the COBOL Explorer view and from the main menu click Project > Properties , expand the Micro Focus node and choose Build Configuration.
  2. Ensure Compile for debugging is set to Yes, and then click Apply and Close.

    By default, Eclipse builds the project each time you change the code or the project's properties. The build produces an updated .class file and an .idy file which is required for debugging.

    You need to configure how debugging will work.

  3. Select your project in the COBOL Explorer view and click Run > Debug Configurations

    This opens the Debug Configurations dialog.

  4. Expand COBOL JVM Application in the left pane. A debug configuration called JVMWorldClass is displayed.
  5. In the Main tab, check Stop in main.
  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.

    The application starts running, and stops at the first instruction in the Main method of the class set class1 to new JVMWorldClass.

    The Debug view shows the threads that are running in the application. Each thread can be expanded to show the call stack for that thread, together with the source code positions. If the sources are available, you can double-click on a call stack entry to go to that location of code, and see the values of local variables as they were on the stack at that point in the execution. 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. Alternatively, press F8 to resume debug.

  7. To stop debugging, click Terminate (Terminate).