Postmortem debugging


The purpose of postmortem debugging is to debug an application after it has already crashed. If your application produced a core file (using the dumper utility) when it faulted, you can examine the state of your application by loading it into the postmortem debugger. This option is available only when you select Debug. When you debug, you're prompted to select a core file.

Before you begin the initial debug process, ensure that either the device or simulator that you want to use is in Development mode.

To enable Development Mode if it is not currently set:

  1. Connect to the device.
  2. On the home screen, swipe down from the top of the screen.
  3. Tap Settings > Security and Privacy > Development Mode.
  4. Tap the Use Development Mode toggle switch.
  5. If prompted, type the password for your device, and tap OK.
To use postmortem debugging to debug your application:
  1. While running, if your application encounters errors, such as divide by zero, the application will crash and create a core file using the dumper utility. Locate the corresponding core file that the IDE produces (.core).

    The dumper utility runs in the background and provides a postmortem dump service for all processes. Whenever a program terminates abnormally, a dump of the current state of the program is written to disk. The dump filename is the same as the program name with a .core extension. For example, if the program name is experiment, the dump is written to experiment.core in your home directory.

  2. Copy the core file to your workspace using the Target File System Navigator.
  3. Right-click on the project in the Project Explorer and create new debug launch configuration of type BlackBerry Postmortem Debugging, and set it to use the newly created core file.
  4. Click Debug.
    Verify that the debug session starts.
  5. In a stack trace, you can navigate to the line in a function where the error occurred.
  6. When finished debugging, in the Debug view, click on the launch configuration, and then click Terminate.

Last modified: 2013-12-21

comments powered by Disqus