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.

  1. On the Window menu, click Show View > QNX Targets > Target File System Navigator.
  2. In the left pane, expand the device or simulator where the app crashed.
  3. In Sandboxes/<app_name>/logs/app_name, copy the app_name.core file to your workspace.
  4. On the toolbar, in the Launch mode drop-down list, click Debug.
  5. In the Launch target drop-down list, click a device or simulator.
  6. In the Launch configuration drop-down list, click Create New Configuration.
  7. On the Initial Launch Mode screen, click Debug, and then click Next.
  8. 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.
  9. In the Core file field, click Browse, select the core file that you copied to your workspace, and then click Finish.
  10. On the toolbar, click Momentics launch button. Verify that the debug session starts.
  11. In a stack trace, navigate to the line in the function where the error occurred.
  12. When you are finished debugging, in the Debug view, click the debug configuration.
  13. On the Debug view toolbar, click The Terminate icon.

Last modified: 2015-07-24

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus