This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [doc patch] gdbserver.1: Document all the options and --multi
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 06 Apr 2013 11:44:55 +0300
- Subject: Re: [doc patch] gdbserver.1: Document all the options and --multi
- References: <20130405181316 dot GA3675 at host2 dot jankratochvil dot net> <83ppy8es8n dot fsf at gnu dot org> <20130405202033 dot GA11174 at host2 dot jankratochvil dot net> <83k3ogdvzg dot fsf at gnu dot org> <20130406064724 dot GA483 at host2 dot jankratochvil dot net>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sat, 6 Apr 2013 08:47:24 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb-patches@sourceware.org
>
> > This is OK, but perhaps will be even better if you describe the last
> > mode first. Then you can put the description of @var{comm} there, and
> > in the other 2 modes say something like "In addition to @var{comm} as
> > above, supply ...".
>
> I do not think it would be good, (1) the --multi mode is IMO an unusual one,
> a special case and (2) I also tried to generally keep the "gdbserver --help"
> output order.
Then let me suggest something specific:
There are three different modes for invoking @command{gdbserver}:
@itemize @bullet
@item
Debug a specific program specified by its program name:
@smallexample
gdbserver @var{comm} @var{prog} [@var{args}@dots{}]
@end smallexample
The @var{comm} parameter specifies how should the server communicate
with @value{GDBN}; it is either a device name (to use a serial line),
a TCP port number (@code{:1234}), or @code{-} or @code{stdio} to use
stdin/stdout of @code{gdbserver}. Specify the name of the program to
debug in @var{prog}. Any remaining arguments will be passed to the
program verbatim. When the program exits, @value{GDBN} will close the
connection, and @code{gdbserver} will exit.
@item
Debug a specific program by specifying the process ID of a running
program:
@smallexample
gdbserver --attach @var{comm} @var{pid}
@end smallexample
The @var{comm} parameter is as described above. Supply the process ID
of a running program in @var{pid}; @value{GDBN} will do everything
else. Like with the previous mode, when the process @var{pid} exits,
@value{GDBN} will close the connection, and @code{gdbserver} will exit.
@item
Multi-process mode -- debug more than one program/process:
@smallexample
gdbserver --multi @var{comm}
@end smallexample
In this mode, @value{GDBN} can instruct @command{gdbserver} which
command(s) to run. Unlike the other 2 modes, @value{GDBN} will not
close the connection when a process being debugged exits, so you can
debug several processes in the same session.
@end itemize
In each of the modes you may specify these options: