Perform postmortem debugging
You can perform postmortem debugging to debug an app after it has crashed.
While running, if your app encounters errors, such as divide-by-zero, the app crashes and creates a core file using the dumper utility. The dumper utility runs in the background and provides a postmortem dump service for all processes. When an app terminates abnormally, a dump of the current state of the app is written to the logs folder in the app's sandbox. The dump file name is the same as the app name with a .core extension. For example, if the app name is experiment, the dump is written to the experiment.core file.
If your app produced a core file when it crashed, you can load it into the postmortem debugging tool and then examine the state of your app. For example, you can use the core file to debug a customer's app.
- On the Window menu, select .
- On the left, expand the device or simulator where the app crashed.
- In Sandboxes/app_name/logs/app_name, copy the app_name.core file to your workspace.
- On the toolbar, in the Launch mode drop-down list, select Debug.
- In the Launch target drop-down list, select a device or simulator.
- In the Launch configuration drop-down list, click Create New Configuration.
- On the Initial Launch Mode screen, select Debug, and then click Next.
- On the Launch Configuration Type screen, select BlackBerry Postmortem Debugging, and then click Next. If you select C/C++ QNX Postmortem Debugging, you must also specify the debugger.
- In the Core file field, click Browse and select the core file that you copied to your workspace, and then click Finish.
- On the toolbar, click . Verify that the debug session starts.
- In a stack trace, navigate to the line in the function where the error occurred.
- When you are finished debugging, in the Debug view, click the debug configuration.
- On the Debug view toolbar, click .
Last modified: 2014-11-17