Gdbserver
Appearance
gdbserver is a program that allows to remotely debug with the GNU Debugger. It runs as a command-line tool on many Unix-like systems.
It only needs the presence of the executable on the target, while the source code stays in the computer used by the developper (with also a copy of the binary file).
How It Works
- gdbserver is launched on the target with the path and name of the executable to debug, and a port number (TCP or UDP). It listens for connections on the port.
- gdb is run on the host with the path and name of the executable (and the sources) on the host, and the IP address and port number to connect to the target.
This is a example of a command to run on the target (where "hello_world" is the name of the executable and "2345" the TCP port number):
gdbserver hello_world :2345
From the host side, {{{gdb}}} is run in the standard way
gdb hello_world
and then needs to connect
target remote 192.168.0.11:2345