This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit+7.6] [patch+7.6] Fix 7.5 regression crashing GDB if gdbserver dies
- From: Yao Qi <yao at codesourcery dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>, Hui Zhu <hui_zhu at mentor dot com>
- Date: Tue, 2 Apr 2013 11:56:44 +0800
- Subject: Re: [commit+7.6] [patch+7.6] Fix 7.5 regression crashing GDB if gdbserver dies
- References: <20130315195359 dot GA19841 at host2 dot jankratochvil dot net> <514C50EF dot 6030202 at redhat dot com> <20130322191841 dot GA29259 at host2 dot jankratochvil dot net> <514CB6D4 dot 9070909 at redhat dot com> <20130322204243 dot GA31871 at host2 dot jankratochvil dot net>
On 03/23/2013 04:42 AM, Jan Kratochvil wrote:
> +set server_pid [exp_pid -i [board_info target fileid]]
> +remote_exec target "kill -9 $server_pid"
> +
> +gdb_test "step" "Remote connection closed"
Jan,
I got a fail in this test (on Lucid x86_64),
Executing on native-gdbserver: kill -9 31336 {} {} {} (timeout = 300)
spawn -ignore SIGHUP kill -9 31336 ^M
kill: : invalid process id^M
kill: : invalid process id^M
kill: : invalid process id^M
step^M
Cannot find bounds of current function
(gdb) FAIL: gdb.server/server-kill.exp: step
The GDB's output of command 'step' is unexpected but looks reasonable
to me. What we want to check here is GDB gets "connection closed" when
GDBserver died, so any commands which talk with GDBserver should be
qualified. I choose 'tstaus' here, because it simply talks with
GDBserver to get trace status, and don't involve other factors into
it. Note that we can use 'stepi' here, but I think 'tstatus' is simpler
than it, so I choose 'tstatus' in the test finally.
This patch fixes the fail I saw. Is it OK for mainline and 7.6?
--
Yao (éå)
gdb/testsuite:
2013-04-02 Yao Qi <yao@codesourcery.com>
* gdb.server/server-kill.exp: Use command 'tstatus' instead of
'step'.
---
gdb/testsuite/gdb.server/server-kill.exp | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gdb/testsuite/gdb.server/server-kill.exp b/gdb/testsuite/gdb.server/server-kill.exp
index 45a2a89..1b48152 100644
--- a/gdb/testsuite/gdb.server/server-kill.exp
+++ b/gdb/testsuite/gdb.server/server-kill.exp
@@ -40,4 +40,6 @@ delete_breakpoints
set server_pid [exp_pid -i [board_info target fileid]]
remote_exec target "kill -9 $server_pid"
-gdb_test "step" "Remote connection closed"
+# Force GDB to talk with GDBserver, so that we can get the
+# "connection closed" error.
+gdb_test "tstatus" "Remote connection closed"
--
1.7.7.6