This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] Mention pidof in gdbserver documentation
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 29 Jun 2003 17:31:41 -0400
- Subject: [RFA] Mention pidof in gdbserver documentation
Since it was asked... this describes how to attach to a program by name.
OK?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-06-29 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 29 Jun 2003 21:27:36 -0000
@@ -10744,7 +10744,17 @@ target> gdbserver @var{comm} --attach @v
@end smallexample
@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.
+to point @code{gdbserver} at a binary for the running process. 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}).