Debugging the startup binary

Using the IDE's Debug perspective, you can debug the startup binary of the QNX Neutrino image.
To debug the startup binary:
  1. Change to the Debug perspective if it's not already open.

    The first thing you'll notice is that the target board has been automatically restarted. After waiting for the number of seconds specified in the Reset and Delay (seconds) field in the Startup tab of the launch configuration, the IDE begins uploading the image to the target board through the JTAG pins.

    After the image has been successfully uploaded, the startup program will run until it hits a breakpoint. When the IDE encounters this first breakpoint, in the top-left area of the Debug perspective, you'll see a stack trace for the current code location:

    In your debug results, the stack traces might appear to be more shallow that those you would typically see because the code is not running in a complicated environment but rather directly on the hardware.

    You can use the Registers view to expand and show all of the processor registers on your target board, and their contents over time. While you step through, register rows will change color to indicate a changed value.

    You can also select the Variables tab to view the value of local and global variables for which symbols exist, and you'll see in the Code view and Disassembly view. This second view incorporates the source code into its display, allowing you to easily see which machine instructions correspond to which lines of code.

  2. In either the Code view or the Disassembly view, you can add and remove breakpoints by double-clicking in the margin. You can use the Step and Continue actions at the top of the view to resume execution.
When you've finished debugging, you should remove all breakpoints and click Continue to let the startup program finish. A quick look at the serial console will show a fully booted QNX Neutrino image.