Debugging non-IDE code

Updated: October 26, 2022

You can debug code written and compiled outside of the IDE. All you need is a launch configuration—you don't need to create an IDE project to store the code.

The steps shown here work for debugging code written on the same host but built outside of the IDE or even code written (and built) on another machine. For the second case, though, you must have a copy of the source files somewhere on your host, so GDB can display the code during debugging.
Note: For code written in an earlier IDE version, you should import the projects into the new IDE. You can continue developing projects built with recent QNX SDP versions, because the IDE lets you switch between the SDKs of the various SDP installations.
To debug non-IDE code:
  1. Create a launch configuration for running the appropriate binary.

    In the C/C++ Application field in the Main tab, you must provide the full path to the binary located outside of the workspace.

    If you're debugging code that was compiled on another machine, you need to tell the IDE where to find the source files on the host, by defining the appropriate paths in the Source tab.

  2. Click the Debug button (Icon: Debug button).

The IDE switches to the Debug perspective, which displays the source code being traced and other essential debugging information. Then, it starts running the binary and GDB, which it attaches to the binary. If configured to do so in the Debug settings, the debugger stops on startup (by default, in the first line of main()).

For information on the debugging controls, see Debug perspective controls.