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