Postmortem debugging

The purpose of postmortem debugging is to debug an application after it has already crashed. If your application produced a dump 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 dump 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. Click the Setting icon.

    The Setting icon.

  3. Select Security in the left navigator.
  4. Select Development Mode from the list of security options.
  5. Next to the Use Development Mode label, set the Development Mode setting to ON.
  6. In the Device password field, type the password for your device, and click Return.
  7. Click Back.
  8. On the home screen of the device, to verify that the Development Mode was set, verify that the Development Mode icon is displayed at the top:

    The Development Mode icon.

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 Tablet OS Postmortem Debugging, and set it to use the newly created core file.
  4. In the Debugger, select an appropriate gdb for your BlackBerry Tablet OS application, such as ${HOME}\win32\x86\usr\bin\ntoarm-gdb.exe.
  5. Click Debug.
    Verify that the debug session starts.
  6. In a stack trace, you can navigate to the line in a function where the error occurred.
  7. When finished debugging, in the Debug view, click on the launch configuration, and then click Terminate.