Initial creation of sourceware repository
[deliverable/binutils-gdb.git] / gdb / gdbserver / gdbserver.1
CommitLineData
c906108c
SS
1.\" Copyright (c) 1993 Free Software Foundation
2.\" See section COPYING for conditions for redistribution
3.TH gdbserver 1 "2 November 1993" "Cygnus Support" "GNU Development Tools"
4.SH NAME
5gdbserver \- Remote Server for the GNU Debugger
6.SH SYNOPSIS
7.na
8.TP
9.B gdbserver
10.RB tty
11.RB prog
12.RB "[\|" args... "\|]"
13.ad b
14.SH DESCRIPTION
15GDBSERVER is a program that allows you to run GDB on a different machine
16than the one which is running the program being debugged.
17
18Usage (server (target) side):
19
20First, you need to have a copy of the program you want to debug put onto
21the target system. The program can be stripped to save space if needed, as
22GDBserver doesn't care about symbols. All symbol handling is taken care of by
23the GDB running on the host system.
24
25To use the server, you log on to the target system, and run the `gdbserver'
26program. You must tell it (a) how to communicate with GDB, (b) the name of
27your program, and (c) its arguments. The general syntax is:
28
29 target> gdbserver COMM PROGRAM [ARGS ...]
30
31For example, using a serial port, you might say:
32
33 target> gdbserver /dev/com1 emacs foo.txt
34
35This tells gdbserver to debug emacs with an argument of foo.txt, and to
36communicate with GDB via /dev/com1. Gdbserver now waits patiently for the
37host GDB to communicate with it.
38
39To use a TCP connection, you could say:
40
41 target> gdbserver host:2345 emacs foo.txt
42
43This says pretty much the same thing as the last example, except that we are
44going to communicate with the host GDB via TCP. The `host:2345' argument means
45that we are expecting to see a TCP connection from `host' to local TCP port
462345. (Currently, the `host' part is ignored.) You can choose any number you
47want for the port number as long as it does not conflict with any existing TCP
48ports on the target system. This same port number must be used in the host
49GDBs `target remote' command, which will be described shortly. Note that if
50you chose a port number that conflicts with another service, gdbserver will
51print an error message and exit.
52
53Usage (host side):
54
55You need an unstripped copy of the target program on your host system, since
56GDB needs to examine it's symbol tables and such. Start up GDB as you normally
57would, with the target program as the first argument. (You may need to use the
58--baud option if the serial line is running at anything except 9600 baud.)
59Ie: `gdb TARGET-PROG', or `gdb --baud BAUD TARGET-PROG'. After that, the only
60new command you need to know about is `target remote'. It's argument is either
61a device name (usually a serial device, like `/dev/ttyb'), or a HOST:PORT
62descriptor. For example:
63
64 (gdb) target remote /dev/ttyb
65
66communicates with the server via serial line /dev/ttyb, and:
67
68 (gdb) target remote the-target:2345
69
70communicates via a TCP connection to port 2345 on host `the-target', where
71you previously started up gdbserver with the same port number. Note that for
72TCP connections, you must start up gdbserver prior to using the `target remote'
73command, otherwise you may get an error that looks something like
74`Connection refused'.
75.SH OPTIONS
76You have to supply the name of the program to debug
77and the tty to communicate on; the remote GDB will do everything else.
78Any remaining arguments will be passed to the program verbatim.
79.SH "SEE ALSO"
80.RB "`\|" gdb "\|'"
81entry in
82.B info\c
83\&;
84.I
85Using GDB: A Guide to the GNU Source-Level Debugger\c
86, Richard M. Stallman and Roland H. Pesch, July 1991.
87.SH COPYING
88Copyright (c) 1993 Free Software Foundation, Inc.
89.PP
90Permission is granted to make and distribute verbatim copies of
91this manual provided the copyright notice and this permission notice
92are preserved on all copies.
93.PP
94Permission is granted to copy and distribute modified versions of this
95manual under the conditions for verbatim copying, provided that the
96entire resulting derived work is distributed under the terms of a
97permission notice identical to this one.
98.PP
99Permission is granted to copy and distribute translations of this
100manual into another language, under the above conditions for modified
101versions, except that this permission notice may be included in
102translations approved by the Free Software Foundation instead of in
103the original English.
This page took 0.033158 seconds and 4 git commands to generate.