aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/testsuite/gdb.mi/mi-nonstop.exp11
-rw-r--r--gdb/testsuite/lib/gdb.exp20
-rw-r--r--gdb/testsuite/lib/mi-support.exp9
4 files changed, 41 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 209f7c7..c4b89e7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+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.
+
2014-11-28 Pedro Alves <palves@redhat.com>
* cp-name-parser.y (conversion_op): Use
diff --git a/gdb/testsuite/gdb.mi/mi-nonstop.exp b/gdb/testsuite/gdb.mi/mi-nonstop.exp
index d2cb95b..50cf497 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
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 90e8644..beb97ea 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3023,25 +3023,33 @@ proc skip_compile_feature_tests {} {
return $result
}
-# Check whether we're testing with the remote or extended-remote
-# targets.
+# Helper for gdb_is_target_remote. PROMPT_REGEXP is the expected
+# prompt.
-proc gdb_is_target_remote {} {
- global gdb_prompt
+proc gdb_is_target_remote_prompt { prompt_regexp } {
set test "probe for target remote"
gdb_test_multiple "maint print target-stack" $test {
- -re ".*emote serial target in gdb-specific protocol.*$gdb_prompt $" {
+ -re ".*emote serial target in gdb-specific protocol.*$prompt_regexp" {
pass $test
return 1
}
- -re "$gdb_prompt $" {
+ -re "$prompt_regexp" {
pass $test
}
}
return 0
}
+# Check whether we're testing with the remote or extended-remote
+# targets.
+
+proc gdb_is_target_remote {} {
+ global gdb_prompt
+
+ return [gdb_is_target_remote_prompt "$gdb_prompt $"]
+}
+
# Return 1 if the current remote target is an instance of our GDBserver, 0
# otherwise. Return -1 if there was an error and we can't tell.
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 07a84ea..9619fb3 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -2499,3 +2499,12 @@ proc mi_skip_python_tests {} {
global mi_gdb_prompt
return [skip_python_tests_prompt "$mi_gdb_prompt$"]
}
+
+# Check whether we're testing with the remote or extended-remote
+# targets.
+
+proc mi_is_target_remote {} {
+ global mi_gdb_prompt
+
+ return [gdb_is_target_remote_prompt "$mi_gdb_prompt"]
+}