* configure.in: Change i[34]86 to i[345]86.
[deliverable/binutils-gdb.git] / gdb / gdbserver / README
CommitLineData
4b9583de
SG
1This is a test line for tags testing.
2
17f087a8
SG
3 README for GDBserver
4 by Stu Grossman
5
6Introduction:
7
8This is GDBserver, a remote server for Un*x-like systems. It can be used to
4b9583de 9control the execution of a program on a target system from a GDB on a different
17f087a8 10host. GDB and GDBserver communicate using the standard remote serial protocol
4b9583de 11implemented in remote.c, and various *-stub.c files. They communicate via
17f087a8
SG
12either a serial line or a TCP connection.
13
14Usage (server (target) side):
15
4b9583de
SG
16First, you need to have a copy of the program you want to debug put onto
17the target system. The program can be stripped to save space if needed, as
18GDBserver doesn't care about symbols. All symbol handling is taken care of by
19the GDB running on the host system.
20
21To use the server, you log on to the target system, and run the `gdbserver'
22program. You must tell it (a) how to communicate with GDB, (b) the name of
23your program, and (c) its arguments. The general syntax is:
24
25 target> gdbserver COMM PROGRAM [ARGS ...]
17f087a8 26
4b9583de 27For example, using a serial port, you might say:
17f087a8
SG
28
29 target> gdbserver /dev/com1 emacs foo.txt
30
4b9583de
SG
31This tells gdbserver to debug emacs with an argument of foo.txt, and to
32communicate with GDB via /dev/com1. Gdbserver now waits patiently for the
33host GDB to communicate with it.
17f087a8
SG
34
35To use a TCP connection, you could say:
36
37 target> gdbserver host:2345 emacs foo.txt
38
39This says pretty much the same thing as the last example, except that we are
4b9583de
SG
40going to communicate with the host GDB via TCP. The `host:2345' argument means
41that we are expecting to see a TCP connection from `host' to local TCP port
422345. (Currently, the `host' part is ignored.) You can choose any number you
43want for the port number as long as it does not conflict with any existing TCP
44ports on the target system. This same port number must be used in the host
45GDBs `target remote' command, which will be described shortly. Note that if
46you chose a port number that conflicts with another service, gdbserver will
47print an error message and exit.
17f087a8
SG
48
49Usage (host side):
50
4b9583de
SG
51You need an unstripped copy of the target program on your host system, since
52GDB needs to examine it's symbol tables and such. Start up GDB as you normally
53would, with the target program as the first argument. (You may need to use the
54--baud option if the serial line is running at anything except 9600 baud.)
55Ie: `gdb TARGET-PROG', or `gdb --baud BAUD TARGET-PROG'. After that, the only
56new command you need to know about is `target remote'. It's argument is either
57a device name (usually a serial device, like `/dev/ttyb'), or a HOST:PORT
58descriptor. For example:
17f087a8
SG
59
60 (gdb) target remote /dev/ttyb
61
4b9583de 62communicates with the server via serial line /dev/ttyb, and:
17f087a8
SG
63
64 (gdb) target remote the-target:2345
65
4b9583de
SG
66communicates via a TCP connection to port 2345 on host `the-target', where
67you previously started up gdbserver with the same port number. Note that for
68TCP connections, you must start up gdbserver prior to using the `target remote'
69command, otherwise you may get an error that looks something like
70`Connection refused'.
17f087a8
SG
71
72Building:
73
74Currently, the only target system supported by the server is Lynx. To build
75the server for Lynx, make a new copy of the distribution onto a disk that is
76NFS shared with the Lynx system. Lets say that's in a directory called xyzzy.
77Then, follow these steps under the host system:
78
79 1) cd xyzzy/gdb/gdbserver
80 2) ../../configure --target i386-none-lynx
81
82When that completes, do the following on the Lynx system:
83
84 3) cd xyzzy/gdb/gdbserver
85 4) make CC=gcc
86
87It should build with only a minor complaint about NULL being redefined. That's
88a LynxOS problem, and can be ignored.
89
90It's also possible that you may have a cross-compiler to Lynx. In that case,
91you can skip the stuff about NFS. You would replace steps 3 & 4 with:
92
93 make CC=lynx-target-compiler...
This page took 0.097221 seconds and 4 git commands to generate.