[gdb/testsuite] Test skip_libstdcxx_probe_tests in mi-catch-cpp-exceptions.exp
[external/binutils.git] / gdb / testsuite / lib / gdb.exp
index 49ec8b2..54cee2e 100644 (file)
@@ -3104,22 +3104,27 @@ proc skip_unwinder_tests {} {
 
 # Return 0 if we should skip tests that require the libstdc++ stap
 # probes.  This must be invoked while gdb is running, after shared
-# libraries have been loaded.
-
-proc skip_libstdcxx_probe_tests {} {
-    global gdb_prompt
+# libraries have been loaded.  PROMPT_REGEXP is the expected prompt.
 
+proc skip_libstdcxx_probe_tests_prompt { prompt_regexp } {
     set ok 0
     gdb_test_multiple "info probe" "check for stap probe in libstdc++" {
-       -re ".*libstdcxx.*catch.*\r\n$gdb_prompt $" {
+       -re ".*libstdcxx.*catch.*\r\n$prompt_regexp" {
            set ok 1
        }
-       -re "\r\n$gdb_prompt $" {
+       -re "\r\n$prompt_regexp" {
        }
     }
     return $ok
 }
 
+# As skip_libstdcxx_probe_tests_prompt, with gdb_prompt.
+
+proc skip_libstdcxx_probe_tests {} {
+    global gdb_prompt
+    return [skip_libstdcxx_probe_tests_prompt "$gdb_prompt $"]
+}
+
 # Return 1 if we should skip tests of the "compile" feature.
 # This must be invoked after the inferior has been started.