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:
- Connect to the device.
- On the home screen, swipe down from the top of the screen.
- Tap Settings > Security and Privacy > Development Mode.
- Tap the Use Development Mode toggle switch.
- If prompted, type the password for your device, and tap OK.
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.
- Copy the core file to your workspace using the Target File System Navigator.
- 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.
Verify that the debug session starts.
- In a stack trace, you can navigate to the line in a function where the error occurred.
- When finished debugging, in the Debug view, click on the launch configuration, and then click Terminate.
Last modified: 2013-12-21