Jump to content

Gdbserver

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Smappy (talk | contribs) at 23:40, 11 February 2010 (ref/unclear). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.[clarification needed]

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

  1. 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.
  2. 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

See Also