Launching an application with the debugger attached

You can launch an application with the debugger attached to step through its entire code path.

To debug applications, your host machine must have an IP or serial connection to your target machine, so the IDE can communicate with the target-side components. Details on setting up these components are given in Host-target communications.

Note: All application binaries—executable and library—on your host must match those on your target so GDB can step through the code. To debug, the host and target must run the same SDP build. Even a minor difference in library binaries prevents the debugger from working correctly.
To launch an application with the debugger attached:
  1. In the launch bar, expand the Launch Configuration dropdown (which is in the middle) and select the project defining the application that you want to debug.
  2. In the Launch Target dropdown (on the right), select the target on which you want to debug your application.
  3. In the Launch Mode dropdown (on the left), select Debug.
  4. 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. If necessary, the IDE builds the application binary (with debugging information) and uploads it to the target. 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()).