summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-11-30 16:05:12 +0000
committerPedro Alves <palves@redhat.com>2015-11-30 18:36:30 +0000
commitf015c27b5294eaf87d0aa814d94972e65c7cc90e (patch)
treeaa5d583a72d54ff1957a04c777130303e114cc5b /gdb/testsuite/gdb.mi
parent01a49af81b74c425baf1215760d50889bd68f27c (diff)
Fix mi-nonstop.exp with extended-remote
Testing with "maint set target-non-stop on" makes mi-nonstop.exp run with the extended-remote board. That reveals that mi-nonstop.exp is using the wrong predicate to check for "using remote protocol". This is not visible today because non-stop tests all fail to run with extended-remote board, because they spawn gdb and then do "set non-stop on". However, with that board, gdb connects to the gdbserver from within mi_gdb_start, and changing non-stop when already connected doesn't work. Fix that by instead enabling non-stop mode on gdb's command line. gdb/testsuite/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> * gdb.mi/mi-nonstop.exp: Append "set non-stop on" to GDBFLAGS instead of issuing "-gdb-set non-stop 1" after starting gdb. Use mi_is_target_remote instead of checking "is_remote target". * lib/gdb.exp (gdb_is_target_remote): Rename to ... (gdb_is_target_remote_prompt): ... this, and add 'prompt_regexp' parameter. (gdb_is_target_remote): Reimplement. * lib/mi-support.exp (mi_is_target_remote): New procedure.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-nonstop.exp11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-nonstop.exp b/gdb/testsuite/gdb.mi/mi-nonstop.exp
index d2cb95b0a9..50cf4979e0 100644
--- a/gdb/testsuite/gdb.mi/mi-nonstop.exp
+++ b/gdb/testsuite/gdb.mi/mi-nonstop.exp
@@ -23,8 +23,12 @@ load_lib mi-support.exp
set MIFLAGS "-i=mi"
gdb_exit
-if {[mi_gdb_start]} {
- continue
+
+save_vars { GDBFLAGS } {
+ append GDBFLAGS " -ex \"set non-stop on\""
+ if {[mi_gdb_start]} {
+ continue
+ }
}
proc mi_nonstop_resume { command test } {
@@ -49,7 +53,6 @@ if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $option
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load $binfile
-mi_gdb_test "-gdb-set non-stop 1" ".*"
mi_gdb_test "-gdb-set mi-async 1" ".*"
mi_detect_async
@@ -132,7 +135,7 @@ mi_gdb_test "-thread-select 2" "\\^done.*" "select first worker thread"
mi_gdb_test "-gdb-set --thread 3 variable exit_first_thread=1" ".*\\^done" "ask the second thread to exit"
set test "wait for thread exit"
-if { [is_remote target] } {
+if { [mi_is_target_remote] } {
# The remote protocol doesn't have support for thread exit
# notifications.
unsupported $test