Copyright (C) 2000-2012 |
Whole document tree
13.4.1.5 Using the
|
target> gdbserver comm program [ args ... ] |
comm is either a device name (to use a serial line) or a TCP hostname and portnumber. For example, to debug Emacs with the argument `foo.txt' and communicate with GDB over the serial port `/dev/com1':
target> gdbserver /dev/com1 emacs foo.txt |
gdbserver
waits passively for the host GDB to communicate
with it.
To use a TCP connection instead of a serial line:
target> gdbserver host:2345 emacs foo.txt |
The only difference from the previous example is the first argument,
specifying that you are communicating with the host GDB via
TCP. The `host:2345' argument means that gdbserver
is to
expect a TCP connection from machine `host' to local TCP port 2345.
(Currently, the `host' part is ignored.) You can choose any number
you want for the port number as long as it does not conflict with any
TCP ports already in use on the target system (for example, 23
is
reserved for telnet
).(5) You must use the same port number with the host GDB
target remote
command.
target
remote
to establish communications with gdbserver
. Its argument
is either a device name (usually a serial device, like
`/dev/ttyb'), or a TCP port descriptor in the form
host:PORT
. For example:
(gdb) target remote /dev/ttyb |
communicates with the server via serial line `/dev/ttyb', and
(gdb) target remote the-target:2345 |
communicates via a TCP connection to port 2345 on host `the-target'.
For TCP connections, you must start up gdbserver
prior to using
the target remote
command. Otherwise you may get an error whose
text depends on the host system, but which usually looks something like
`Connection refused'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |