Debug a program (build an executable for debugging)

Although you can debug a regular executable, you'll get much more information and control by building debug variants of the executables. To build an executable with debugging information, you must pass the -g option to the compiler. If you're using a QNX Make project, the filename for the debug variant has _g appended to it.
To specify the -g option from the project options:
  1. In the Project Explorer view, right-click the project and select Properties.
  2. In the left pane, select QNX C/C++ Project.
  3. In the right pane, select the Build Variants tab.
  4. Under your selected build variants, make sure Debug is enabled:

  5. Click Apply.
  6. Click OK.
  7. Rebuild your project (unless you're using the IDE's autobuild feature).
For more information about setting project options, see the Project properties chapter.