|
|
 |
Getting Started Guide
User mode debugging
|
|
User mode debugging
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 distinct 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 ethernet connection) with debug server software executing on the target Linux system. The server software runs and controls the user application under debug, and performs debug operations on behalf of the remote client.
- Use a native debugger, which runs on the same target Linux system as the user application being debugged. This controls the application and performs debug operations upon it directly.
There are advantages and disadvantages of both approaches.
- The cross debug approach allows the host system to run the main debugger, but with the extra complexity of having to set up a socket on the target through which the debug server can wait for commands from the debug client running on the host system.
- The native debug approach requires a target which has been set up with sufficient resources to run the target development tools. In particular, the target must have access to the host file system for reading source code, and the debugger requires a large amount of memory on the target for its operation. This approach has the advantage of being easier to set up and operate than a cross debug session, assuming the target has sufficient resources.
These methods are described in Cross debugging with GDB and Native debugging with GDB.
|