Previous Topic Next topic Print topic


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 checked and click OK.

    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. Double-click the COBOL JVM Application tree item to create a new debug configuration. This creates a new configuration in the tree view, JVMWorldClass
  5. Click Search and choose JVMWorldClass - com.microfocus.examples to locate the Main class in your application.
  6. Check Stop in main.
  7. 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 Yes 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.

  8. To stop debugging, click Terminate (Terminate).
Previous Topic Next topic Print topic