The standard tool for debugging programs under Linux is the GNU project debugger GDB. For more information on GDB, see the project website, which includes full user documentation on GDB describing its extensive range of features, capabilities and commands.

There are two ways to use GDB to debug a user program running on a target system under STLinux.

  • Use a cross debugger, which is executed as a client on the host system communicating (using a serial or, mostly usually, an ethernet connection) with a debug server executing on the target. The server runs and controls the user application under debug, and performs debug operations on behalf of the remote client.

  • Use a native debugger, running on the same target Linux system as the user application. This controls the application and performs debug operations upon it directly.

In most cases, the cross debug techinque is recommended. It allows the debugger to be executed on the system that built the application, giving easy access to the sources, and means that the majority of the memory and cpu required for the debugger come from the host system.

These methods are described in Cross debugging with GDB and Native debugging with GDB.