diff options
author | Pedro Alves <palves@redhat.com> | 2013-10-02 11:42:35 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-10-02 11:42:35 +0000 |
commit | 1a3d890bcc0e6f9fe0116b3274023ae0af847593 (patch) | |
tree | 1a74f7f5d094a7892d55bb51b13febc92840a762 /gdb/gdbserver/server.c | |
parent | 042a84d96cc820d4d2b57e98443bbb3756f2f876 (diff) | |
download | gdb-1a3d890bcc0e6f9fe0116b3274023ae0af847593.zip gdb-1a3d890bcc0e6f9fe0116b3274023ae0af847593.tar.gz gdb-1a3d890bcc0e6f9fe0116b3274023ae0af847593.tar.bz2 |
[GDBserver]: Silence exits if GDB is connected through stdio.
If we make gdbserver gdb_continue_to_end actually expect a process
exit with GDBserver, we get many testsuite failures with the remote
stdio board:
-PASS: gdb.arch/amd64-disp-step.exp: continue until exit at amd64-disp-step
+FAIL: gdb.arch/amd64-disp-step.exp: continue until exit at amd64-disp-step (the program exited)
-PASS: gdb.base/break.exp: continue until exit at recursive next test
+FAIL: gdb.base/break.exp: continue until exit at recursive next test (the program exited)
-PASS: gdb.base/chng-syms.exp: continue until exit at breakpoint first time through
+FAIL: gdb.base/chng-syms.exp: continue until exit at breakpoint first time through (the program exited)
... etc. ...
This is what the log shows for all of them:
(gdb) continue
Continuing.
Child exited with status 0
GDBserver exiting
[Inferior 1 (process 22721) exited normally]
(gdb) FAIL: gdb.arch/amd64-disp-step.exp: continue until exit (the program exited)
The problem is the whole "Child exited ... GDBserver exiting" output,
that comes out of GDBserver, and that the testsuite is not expecting.
I pondered somehow making the testsuite adjust to this. But,
testsuite aside, I think GDBserver should not be outputting this at
all when GDB is connected through stdio. GDBserver will be printing
this in GDB's console, but the user can already tell from the regular
output that the inferior is gone.
Again, manually:
(gdb) tar remote | ./gdbserver/gdbserver - program
Remote debugging using | ./gdbserver/gdbserver - program
Process program created; pid = 22486
stdin/stdout redirected
Remote debugging using stdio
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x000000323d001530 in _start () from /lib64/ld-linux-x86-64.so.2
(gdb) c
Continuing.
Child exited with status 1
^^^^^^^^^^^^^^^^^^^^^^^^^^
GDBserver exiting
^^^^^^^^^^^^^^^^^
[Inferior 1 (process 22486) exited with code 01]
(gdb)
Suppressing those two lines makes the output be exactly like when
debugging against a remote tcp gdbserver:
(gdb) c
Continuing.
[Inferior 1 (process 22914) exited with code 01]
(gdb)
2013-10-02 Pedro Alves <palves@redhat.com>
* server.c (process_serial_event): Don't output "GDBserver
exiting" if GDB is connected through stdio.
* target.c (mywait): Likewise, be silent if GDB is connected
through stdio.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r-- | gdb/gdbserver/server.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 4de20d5..e0af785 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -3550,7 +3550,10 @@ process_serial_event (void) the whole vStopped list (until it gets an OK). */ if (QUEUE_is_empty (notif_event_p, notif_stop.queue)) { - fprintf (stderr, "GDBserver exiting\n"); + /* Be transparent when GDB is connected through stdio -- no + need to spam GDB's console. */ + if (!remote_connection_is_stdio ()) + fprintf (stderr, "GDBserver exiting\n"); remote_close (); exit (0); } |