3.6. GDB Server

Sourcery G++ Lite contains a gdbserver for running on the target. The server executable is located in the sysroot/usr/bin directory of your installation, where sysroot is the pathname to the sysroot, as documented in Section 3.2, “Library Configurations”. You need to copy the appropriate gdbserver executable to your target system and then invoke it as

# gdbserver :port program

port can be any available TCP port; 5000 is a common choice. gdbserver waits for a connection from gdb and then commences serving requests for it. To connect to gdbserver from your host system, start gdb, but specify the special .gdb version of your program.

> arm-uclinuxeabi-gdb program.gdb

Then connect to the target system:

(gdb) target remote host:port

At this point you are able to debug as usual.