Debugging a native application

The IDE lets you step through each line of your code and view the value of variables.

These steps assume you've built a native "hello world" application.
Follow these steps to learn how to use the IDE to debug your application:
  1. Ensure that you're in the C/C++ perspective.
  2. Expand the hello_qnx project and double-click hello_qnx.cc.
  3. Edit the main function as follows:

  4. Build the project: right-click over hello_qnx and select Build Project.
  5. Expand Binaries, right-click over hello_qnx_g - [arm/le], and select Debug As > 1 C/C++ QNX Application. The IDE changes to the Debug perspective. The debugger has stopped at the first line of your program. The usual debug controls are located above the Debug view.
  6. Create a breakpoint at the declaration of theAnswer by right-clicking in the column to the right and selecting Toggle Breakpoint. You can also set a breakpoint by simply double-clicking in the column.
  7. Click Resume. The debugger stops at the breakpoint. The value of theAnswer, still the default value, is shown in the Variables view. You can also see the current value of a variable by hovering.
  8. Click Step Over. In the variables view, note that theAnswer is now 41.
  9. Click Step Over. In the variables view, note that theAnswer is now 42.
  10. Click Resume. The output appears in the console and the program terminates.