Perform postmortem debugging
You can perform postmortem debugging to debug an app after it crashes.
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, click Show View > QNX Targets > Target File System Navigator.
- In the left pane, 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, click Debug.
- In the Launch target drop-down list, click a device or simulator.
- In the Launch configuration drop-down list, click Create New Configuration.
- On the Initial Launch Mode screen, click Debug, and then click Next.
- On the Launch Configuration Type screen, click BlackBerry Postmortem Debugging, and then click Next. If you click C/C++ QNX Postmortem Debugging, you must also specify the debugger.
- In the Core file field, click Browse, 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: 2015-07-24