Debugging using a core dump

Important:
  • The following applies to native code only.

When an application crashes or when you programmatically invoke a core dump (using the CBL_CREATE_CORE library routine), you can arrange for its state to be saved to disk, in a core file. The contents of this file can indicate where the error occurred in the source code; it also contains the contents of memory at the time of the error or invocation, and the values of any variables and expressions set at the time. You can then use the core file to help debug any problems.

Core dump debugging is useful when you have a failing application in a production environment, and you don't have the COBOL development system installed. As long as you have access to the application's source files elsewhere, you can produce a core file and debug it.

To accurately debug using a core file, in your development environment, you must use the original source and .idy files used to create the executable in question, or failing that, you must ensure that the sources are in the same state (directive settings, optimization, etc..) as they were during the initial build. Also, as this process will most likely result in you moving from a production environment on one machine, to a development environment on another, any supporting files used by the application (shared libraries, shared objects, third-party libraries, etc…) must be installed along the same path in both environments.

If you do not have the required .idy file, you are given the name of the source file or program where the error occurred.