Previous Topic Next topic Print topic


Debugging Using a Core Dump

You can arrange for the state of an application to be saved to disk in a core dump file when the application crashes. You can then use the dump file to help debug problems, as it indicates where in the source code the error occurred, along with the values of variables, expressions, and the contents of memory as they were at the moment the error occurred.
Important:
  • On Windows, the core dump files created by this product are Microsoft minidump files. If you have a mixed language application you can use the minidump file to debug the other languages involved.
  • The following applies to native code only.

You can produce a core dump even when you don't have the COBOL development system installed. This is valuable when you are debugging a released application on site, and you have only the COBOL Server environment installed.

You must have the source files and an .idy file to get the most detail from the core dump. If you do not have the required files, the IDE indicates that no source is available.

You can produce a core dump file in one of the following ways:

  1. Copy the file cblcored.exe from the bin subfolder in the product installation directory to the same directory as your application's main executable file.
  2. At the command line, go to the directory containing cblcored.exe and type:
    cblcored
  3. From the Core Dump list, select one of the following:
    • Enabled with prompt if you want a message box displayed when a core dump is about to be created.
    • Enabled with no prompt if you do not want a message box displayed when a core dump is about to be created.
    • Disabled if you do not require a core dump.

    If you have selected one of the enabled options, the next time you run the application and an error occurs, the state of the application at the time of the error is saved in the file cblcore. This file is saved in the same folder as the application.

Alternatively, you can configure the system so that it produces a core dump for run-time errors. To do this:

  1. Create a run-time tunable configuration file and add to it the core_on_error tunable.

    The default name of the core dump file to be produced is cblcore. To specify a different file name, add the core_filename tunable to the run-time tunable configuration file.

  2. Run the application. When the application crashes, a core dump is produced.

To debug a core dump file using a native COBOL project:

Note: Ensure that the project and the sources it compiles have not changed since the original executable was created; otherwise, any discrepancies in the .idy file used to debug and the one originally created (when the executable was built) will cause unexpected results during debugging.
  1. In the IDE, click Project > MyProject Properties and navigate to the Debug tab.
  2. Click Start external program and specify the name of the Micro Focus core dump file.
    • On the Debug tab in the project's properties, set Active Settings to Core Dump.
    • Under Core Dump Settings, specify the name of the Micro Focus core dump file.
  3. Click Start external program and specify the name of the Micro Focus core dump file.
  4. When you start debugging you can query the state of the program at the point at which the error occurred.
Note:
  • It is not possible to enable both Just-In-Time Debugging and Core Dump concurrently.
  • To debug a 64-bit core dump you must first create a 64-bit project configuration or select x64 as the Platform target on the COBOL tab in the project's properties.
  • cblcored.exe is one of the COBOL Server files, which is provided for on-site debugging. You are authorised to redistribute this file to your customers providing you have the appropriate license.
  • To create a core dump for an application running under IIS, the application must be run in the same user account as that being used when enabling the core dump feature. For example, a core dump will not be produced for a CGI or ISAPI application running under the default anonymous logon account.
Previous Topic Next topic Print topic