aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/gdb.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r--gdb/testsuite/lib/gdb.exp20
1 files changed, 14 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.