This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: New "attach" and "rsh" features for GDB/gdbserver on PowerPC
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Wolfgang Denk <wd at denx dot de>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 04 Mar 2002 20:05:53 -0500
- Subject: Re: New "attach" and "rsh" features for GDB/gdbserver on PowerPC
- References: <20020304091402.DE57C109E9@denx.denx.de>
Just FYI,
> Description:
>
> Many embedded systems use gdbserver for application debugging.
> However the current implementation (on PowerPC) requires that the
> processes to be debugged are started under control of gdbserver. But
> often you want to debug (examine) some process on the target system
> that is already running. This is supported by the new support for the
> "attach" command.
I get the feeling that this change is pretty sigifnicant in terms of the
protocol (new ``I'' response, new attach packet, ...?). Could you
please post something describing what you plan on changing.
> This allows to have always one instance of gdbserver running on the
> target as a general purpose debug server that can be used to attach
> to any of the running application processes. In this "server mode"
> (when no command to debug is given on the gdbserver command line)
> gdbserver will not terminate when the debugged process exits, thus
> making sure you can continue to use the debug server.
>
> The "rshell" (remote shell) extension allows to use GDB/gdbserver to
> run arbitrary commands on the target system. The main intention is to
> be able to find out the PIDs of the processes you want to attach to
> by running a "ps" command without need for additional services on the
> target.
BTW, there is already the ``(gdb) monitor'' command and the
corresponding ``qRcmd'' packet.
As a general rule, features are always present - using #ifdef
HAVE_TARGET_ATTACH #ifdef FOO #else #endif is probably not a good idea.
enjoy,
Andrew