From: drow Date: Thu, 24 Jul 2003 18:55:04 +0000 (+0000) Subject: * gdb.texinfo (Server): Mention pidof. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5d2deb534dd29383f3e3bea299fd8be7a3a68ea7;p=pf3gnuchains%2Fsourceware.git * gdb.texinfo (Server): Mention pidof. --- diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b877983856..d6310205b5 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2003-07-24 Daniel Jacobowitz + + * gdb.texinfo (Server): Mention pidof. + 2003-07-22 Andrew Cagney * gdbint.texinfo (Coding): Add -Wformat-nonliteral to -Werror diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index e6da37c3b8..5db0bce050 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -10746,6 +10746,19 @@ target> gdbserver @var{comm} --attach @var{pid} @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