From: Wolfgang Denk <wd@denx.de>
To: gdb-patches@sources.redhat.com
Subject: New "attach" and "rsh" features for GDB/gdbserver on PowerPC
Date: Mon, 04 Mar 2002 01:14:00 -0000 [thread overview]
Message-ID: <20020304091402.DE57C109E9@denx.denx.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 3237 bytes --]
Hello,
please find attached a patch to gdb-5.1 that adds support for the
"attach" command and a new "remote shell" command to GDB/gdbserver
for PowerPC systems.
ChangeLog entry:
---------------------------------------------------------------------
2002-03-04 Wolfgang Denk <wd@denx.de>
* add support for "attach" command and new "rshell" (remote
shell) command to GDB/gdbserver for PowerPC systems.
* make gdbserver "resident" if started without process
argument (i. e. when started a server it does not terminate
when a debugged process terminates)
---------------------------------------------------------------------
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.
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.
A typical debugging session would thus look like this:
On the target:
...
# gdbserver :12345 &
Ready to attach to a process
# ./testcode ...
...
On the host:
$ powerpc-linux-gdb testcode
...
(gdb) target remote 192.168.3.17:12345
Remote debugging using 192.168.3.17:12345
(gdb) rsh ps ax
PID TTY STAT TIME COMMAND
1 ? S 0:01 init
2 ? SW 0:00 [keventd]
3 ? SW 0:00 [kswapd]
4 ? SW 0:00 [kreclaimd]
5 ? SW 0:00 [bdflush]
6 ? SW 0:00 [kupdated]
7 ? SW 0:00 [mtdblockd]
8 ? SW 0:00 [rpciod]
51 ? S 0:00 /sbin/portmap
79 ? S 0:00 /sbin/syslogd
81 ? S 0:00 /sbin/klogd
86 ? S 0:00 /usr/sbin/inetd
87 ttyS0 S 0:00 -bash
96 ttyS0 S 0:00 /tmp/gdbserver :12345
97 ttyS0 S 0:00 ./testcode ...
98 ttyS0 R 0:00 ps ax
(gdb) attach 97
Attaching to remote program `/home/wd/testcode' (process 97)...
0x0ff631a4 in ?? ()
(gdb) b 9
Breakpoint 1 at 0x10000580: file testcode.c, line 9.
(gdb) c
Continuing.
...
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
It seems intuitively obvious to me, which means that it might be
wrong. -- Chris Torek
[-- Attachment #2: gdb-5.1.1.patch.gz --]
[-- Type: application/x-gzip , Size: 21916 bytes --]
next reply other threads:[~2002-03-04 9:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-04 1:14 Wolfgang Denk [this message]
2002-03-04 9:02 ` Daniel Jacobowitz
2002-03-04 10:58 ` Wolfgang Denk
2002-03-04 11:36 ` Michael Snyder
2002-03-04 11:43 ` Daniel Jacobowitz
2002-03-04 18:27 ` Andrew Cagney
2002-03-04 18:27 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020304091402.DE57C109E9@denx.denx.de \
--to=wd@denx.de \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox