Index: gdb/testsuite/gdb.server/server-kill.exp |
diff --git a/gdb/testsuite/gdb.server/server-run.exp b/gdb/testsuite/gdb.server/server-kill.exp |
similarity index 58% |
copy from gdb/testsuite/gdb.server/server-run.exp |
copy to gdb/testsuite/gdb.server/server-kill.exp |
index da357b4a21e64a4afb4be08967966aa09f828ec4..75c962705e3a0149bee2b3ea801aacdcb54da0f3 100644 |
--- a/gdb/testsuite/gdb.server/server-run.exp |
+++ b/gdb/testsuite/gdb.server/server-kill.exp |
@@ -1,7 +1,7 @@ |
# This testcase is part of GDB, the GNU debugger. |
- |
-# Copyright 2005, 2007-2012 Free Software Foundation, Inc. |
- |
+# |
+# Copyright 2013 Free Software Foundation, Inc. |
+# |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License as published by |
# the Free Software Foundation; either version 3 of the License, or |
@@ -15,37 +15,31 @@ |
# You should have received a copy of the GNU General Public License |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
-# Test the basic functionality of gdbserver. |
- |
load_lib gdbserver-support.exp |
-standard_testfile server.c |
+standard_testfile |
-if { [skip_gdbserver_tests] } { |
+if {[skip_gdbserver_tests]} { |
return 0 |
} |
-if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { |
+if { [prepare_for_testing ${testfile}.exp ${testfile}] } { |
return -1 |
} |
-gdb_exit |
-gdb_start |
-gdb_load $binfile |
- |
# Make sure we're disconnected, in case we're testing with an |
# extended-remote board, therefore already connected. |
gdb_test "disconnect" ".*" |
gdbserver_run "" |
-gdb_reinitialize_dir $srcdir/$subdir |
-# We are now stopped at the program's entry point. On targets which use |
-# SVR4 dynamic linking, we should have automatically loaded symbols for |
-# the dynamic linker. |
-if { [istarget *-*-linux*] } { |
- gdb_test "info shared" "From.*To.*" "loaded dynamic linker" |
-} |
+# Otherwise the breakpoint at 'main' would not cause insert |
+# breakpoints during first step. |
+delete_breakpoints |
+ |
+set server_pid [exp_pid -i [board_info target fileid]] |
+remote_exec target "kill -9 $server_pid" |
-gdb_breakpoint main |
-gdb_test "continue" "Breakpoint.* main .*" "continue to main" |
+# Force GDB to talk with GDBserver, so that we can get the |
+# "connection closed" error. |
+gdb_test "tstatus" {Remote connection closed|Remote communication error\. Target disconnected\.: Connection reset by peer\.} |