Index: gdb/testsuite/gdb.server/server-run.exp |
diff --git a/gdb/testsuite/gdb.server/server-run.exp b/gdb/testsuite/gdb.server/server-run.exp |
index f9a41e9cf36d1818ed4cc73650bdd7b2aba84792..da357b4a21e64a4afb4be08967966aa09f828ec4 100644 |
--- a/gdb/testsuite/gdb.server/server-run.exp |
+++ b/gdb/testsuite/gdb.server/server-run.exp |
@@ -19,15 +19,13 @@ |
load_lib gdbserver-support.exp |
-set testfile "server" |
-set srcfile ${testfile}.c |
-set binfile ${objdir}/${subdir}/server-run |
+standard_testfile server.c |
if { [skip_gdbserver_tests] } { |
return 0 |
} |
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { |
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { |
return -1 |
} |
@@ -35,6 +33,10 @@ 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 |