Index: gdb/testsuite/gdb.server/ext-run.exp |
diff --git a/gdb/testsuite/gdb.server/ext-run.exp b/gdb/testsuite/gdb.server/ext-run.exp |
index 163e0cfb6e5fde7ef483f642e90574a252288dc7..f397cd925c687fbb7e9fbd80ebf1fc87ef87c696 100644 |
--- a/gdb/testsuite/gdb.server/ext-run.exp |
+++ b/gdb/testsuite/gdb.server/ext-run.exp |
@@ -19,15 +19,13 @@ |
load_lib gdbserver-support.exp |
-set testfile "server" |
-set srcfile ${testfile}.c |
-set binfile ${objdir}/${subdir}/ext-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 |
} |
@@ -40,6 +38,10 @@ gdb_start |
gdb_load $binfile |
gdb_reinitialize_dir $srcdir/$subdir |
+# Make sure we're disconnected, in case we're testing with an |
+# extended-remote board, therefore already connected. |
+gdb_test "disconnect" ".*" |
+ |
set target_exec [gdbserver_download_current_prog] |
gdbserver_start_extended |