aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
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/lib
parent01a49af81b74c425baf1215760d50889bd68f27c (diff)
downloadgdb-f015c27b5294eaf87d0aa814d94972e65c7cc90e.zip
gdb-f015c27b5294eaf87d0aa814d94972e65c7cc90e.tar.gz
gdb-f015c27b5294eaf87d0aa814d94972e65c7cc90e.tar.bz2
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/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp20
-rw-r--r--gdb/testsuite/lib/mi-support.exp9
2 files changed, 23 insertions, 6 deletions
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"]
+}