This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Mention pidof in gdbserver documentation
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 24 Jul 2003 14:57:00 -0400
- Subject: Re: [RFA] Mention pidof in gdbserver documentation
- References: <20030629213141.GA15078@nevyn.them.org> <1438-Sun13Jul2003232236+0300-eliz@elta.co.il>
On Sun, Jul 13, 2003 at 11:22:37PM +0200, Eli Zaretskii wrote:
> [Sorry for a late response.]
>
> > Date: Sun, 29 Jun 2003 17:31:41 -0400
> > From: Daniel Jacobowitz <drow@mvista.com>
> >
> > Since it was asked... this describes how to attach to a program by name.
> > OK?
>
> Yes. However, please add a ``@pindex pidof'' and also some @cindex
> entry with a text like "attach to a program by name".
>
> Thanks.
>
Thanks, this is what I checked in.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-07-24 Daniel Jacobowitz <drow@mvista.com>
* gdb.texinfo (Server): Mention pidof.
Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.169
diff -u -p -r1.169 gdb.texinfo
--- gdb.texinfo 28 Jun 2003 16:19:06 -0000 1.169
+++ gdb.texinfo 24 Jul 2003 18:53:14 -0000
@@ -10746,6 +10746,19 @@ target> gdbserver @var{comm} --attach @v
@var{pid} is the process ID of a currently running process. It isn't necessary
to point @code{gdbserver} at a binary for the running process.
+@pindex pidof
+@cindex attach to a program by name
+You can debug processes by name instead of process ID if your target has the
+@code{pidof} utility:
+
+@smallexample
+target> gdbserver @var{comm} --attach `pidof @var{PROGRAM}`
+@end smallexample
+
+In case more than one copy of @var{PROGRAM} is running, or @var{PROGRAM}
+has multiple threads, most versions of @code{pidof} support the
+@code{-s} option to only return the first process ID.
+
@item On the host machine,
connect to your target (@pxref{Connecting,,Connecting to a remote target}).
For TCP connections, you must start up @code{gdbserver} prior to using