This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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}).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]