Postmortem debugging

You can perform postmortem debugging to debug an application after it has crashed.

While running, if your application encounters errors, such as divide-by-zero, the application 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 application'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 application 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, select Show View > QNX Targets > Target File System Navigator.
  2. On the left, expand the device or simulator where the app crashed.
  3. In Sandboxes/<application name>/logs/<application name>, copy the <application name>.core file to your workspace.
  4. On the toolbar, in the Launch mode drop-down list, select Debug.
  5. In the Launch target drop-down list, select a device or simulator.
  6. In the Launch configuration drop-down list, click Create New Configuration.
  7. On the Initial Launch Mode screen, select Debug, and then click Next.
  8. 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.

  9. In the Core file field, click Browse and 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 finished debugging, in the Debug view, click the debug configuration.
  13. On the Debug view toolbar, click The Terminate icon.

Last modified: 2014-09-30



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

comments powered by Disqus