This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Make the gdb.server/ tests run with the extended-remote board
- From: Pedro Alves <palves at redhat dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Date: Fri, 10 Feb 2012 18:52:22 +0000
- Subject: Make the gdb.server/ tests run with the extended-remote board
While we have these, and while they force remote/extended-remote modes, make
them work with the extended-remote board. This mainly means making sure
we're disconnected, as otherwise the test will try to connect, and gdb will
warn "you're already connected, are you sure do you want to disconnect,
blah, blah?", which neither the tests, nor the infrastructure are expecting.
I still want to go and do a thorougher cleaning up of these tests, as
described in <http://sourceware.org/ml/gdb-patches/2011-12/msg00513.html>.
Meanwhile, this is just a quick patch to drop a bunch of FAILs and timeouts
that aren't real failures with the extended-remote board.
--
Pedro Alves
gdb/testsuite/
2012-02-10 Pedro Alves <palves@redhat.com>
* gdb.server/ext-attach.exp: Make sure gdb is disconnected.
* gdb.server/ext-run.exp: Make sure gdb is disconnected.
* gdb.server/file-transfer.exp: Make sure gdb is disconnected.
* gdb.server/server-mon.exp: Make sure gdb is disconnected.
* gdb.server/server-run.exp: Make sure gdb is disconnected.
* lib/gdbserver-support.exp (gdbserver_start_extended): Only
prepend "extended-" to $gdbserver_protocol if $gdbserver_protocol
doesn't start with "extended-" already.
---
gdb/testsuite/gdb.server/ext-attach.exp | 4 ++++
gdb/testsuite/gdb.server/ext-run.exp | 4 ++++
gdb/testsuite/gdb.server/file-transfer.exp | 4 ++++
gdb/testsuite/gdb.server/server-mon.exp | 4 ++++
gdb/testsuite/gdb.server/server-run.exp | 4 ++++
5 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp
index d9c7c0c..8cfcaaf 100644
--- a/gdb/testsuite/gdb.server/ext-attach.exp
+++ b/gdb/testsuite/gdb.server/ext-attach.exp
@@ -42,6 +42,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
diff --git a/gdb/testsuite/gdb.server/ext-run.exp b/gdb/testsuite/gdb.server/ext-run.exp
index 163e0cf..53938ca 100644
--- a/gdb/testsuite/gdb.server/ext-run.exp
+++ b/gdb/testsuite/gdb.server/ext-run.exp
@@ -40,6 +40,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
diff --git a/gdb/testsuite/gdb.server/file-transfer.exp b/gdb/testsuite/gdb.server/file-transfer.exp
index 6b48b02..12e8f26 100644
--- a/gdb/testsuite/gdb.server/file-transfer.exp
+++ b/gdb/testsuite/gdb.server/file-transfer.exp
@@ -36,6 +36,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" ".*"
+
gdbserver_run ""
proc test_file_transfer { filename description } {
diff --git a/gdb/testsuite/gdb.server/server-mon.exp b/gdb/testsuite/gdb.server/server-mon.exp
index ffe95bc..ca9ee3e 100644
--- a/gdb/testsuite/gdb.server/server-mon.exp
+++ b/gdb/testsuite/gdb.server/server-mon.exp
@@ -36,6 +36,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" ".*"
+
gdbserver_run ""
gdb_test_multiple "monitor help" "monitor help" {
diff --git a/gdb/testsuite/gdb.server/server-run.exp b/gdb/testsuite/gdb.server/server-run.exp
index f9a41e9..88031e7 100644
--- a/gdb/testsuite/gdb.server/server-run.exp
+++ b/gdb/testsuite/gdb.server/server-run.exp
@@ -35,6 +35,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
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
index 6d3a0e5..ee66e48 100644
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -364,7 +364,10 @@ proc gdbserver_start_extended { } {
global use_gdb_stub
set res [gdbserver_start "--multi" ""]
- set gdbserver_protocol "extended-[lindex $res 0]"
+ set gdbserver_protocol [lindex $res 0]
+ if { [string first "extended-" $gdbserver_protocol] != 0} {
+ set gdbserver_protocol "extended-$gdbserver_protocol"
+ }
set gdbserver_gdbport [lindex $res 1]
# Even if the board file is testing with target remote, our caller