This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/gdbserver] Be slightly more verbose
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 28 Feb 2004 13:06:27 -0500
- Subject: [patch/gdbserver] Be slightly more verbose
These patches normalize gdbserver's output in a couple of cases. Now, for
both normal and attach operation, and for both serial and TCP operation,
gdbserver will print out one line of output before it is ready for input
and another line of output after it is ready for input, without blocking.
This lets me update the test harness to not issue "target remote" until
gdbserver is actually ready for a connection; on very slow targets, like the
one I've been using all week, this can prevent time-consuming retries.
No change in testsuite results, just a nice change in testsuite run time.
Will commit in a bit.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-02-28 Daniel Jacobowitz <drow@mvista.com>
* remote-utils.c (remote_open): Print a status notice after
opening a TCP port.
* server.c (attach_inferior): Print a status notice after
attaching.
Index: gdb/gdbserver/remote-utils.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/gdbserver/remote-utils.c,v
retrieving revision 1.17
diff -u -p -r1.17 remote-utils.c
--- gdb/gdbserver/remote-utils.c 5 Jun 2003 14:26:58 -0000 1.17
+++ gdb/gdbserver/remote-utils.c 27 Feb 2004 20:54:11 -0000
@@ -135,6 +135,8 @@ remote_open (char *name)
|| listen (tmp_desc, 1))
perror_with_name ("Can't bind address");
+ fprintf (stderr, "Listening on port %d\n", port);
+
tmp = sizeof (sockaddr);
remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp);
if (remote_desc == -1)
Index: gdb/gdbserver/server.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/gdbserver/server.c,v
retrieving revision 1.16
diff -u -p -r1.16 server.c
--- gdb/gdbserver/server.c 13 Oct 2003 16:17:21 -0000 1.16
+++ gdb/gdbserver/server.c 28 Feb 2004 03:06:13 -0000
@@ -70,6 +70,8 @@ attach_inferior (int pid, char *statuspt
if (myattach (pid) != 0)
return -1;
+ fprintf (stderr, "Attached; pid = %d\n", pid);
+
/* FIXME - It may be that we should get the SIGNAL_PID from the
attach function, so that it can be the main thread instead of
whichever we were told to attach to. */