From: Pedro Alves Date: Wed, 15 Feb 2012 12:51:17 +0000 (+0000) Subject: 2012-02-15 Pedro Alves X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1999d402252588a8087f705f21da889135a222c;p=binutils-gdb.git 2012-02-15 Pedro Alves * 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. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 86da87fbf18..5816b0d33eb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2012-02-15 Pedro Alves + + * 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. + 2012-02-15 Pedro Alves Support extended-remote. Avoid cascading timeouts. diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp index d9c7c0cdc7a..8cfcaaf4f77 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 163e0cfb6e5..53938ca41ef 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 6b48b0236e0..12e8f26a7bc 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 ffe95bc7b9f..ca9ee3ed69a 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 f9a41e9cf36..88031e7aa35 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 6d3a0e56e1c..ee66e48260a 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