]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Make skip_libstdcxx_probe_tests return 1 if true
authorTom de Vries <tdevries@suse.de>
Mon, 26 Aug 2019 16:48:02 +0000 (18:48 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 26 Aug 2019 16:48:02 +0000 (18:48 +0200)
The tcl proc skip_libstdcxx_probe_tests currently returns 0 if the probe tests
need to be skipped, while tcl interprets 0 as false rather than true, which is
confusing.

Fix this by making skip_libstdcxx_probe_tests return 1 if the probe tests need
to be skipped.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-08-26  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (skip_libstdcxx_probe_tests_prompt): Return 1 if probe
* tests need to be skipped.
* gdb.cp/exceptprint.exp: Update call to skip_libstdcxx_probe_tests.
* gdb.mi/mi-catch-cpp-exceptions.exp: Update call to
mi_skip_libstdcxx_probe_tests.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/exceptprint.exp
gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
gdb/testsuite/lib/gdb.exp

index e8445f8e88b34a05741dc8bfbe28f9a5daed643b..c41b4981e33d7502cc5a08dead0fb1cfb49f7d58 100644 (file)
@@ -1,3 +1,11 @@
+2019-08-26  Tom de Vries  <tdevries@suse.de>
+
+       * lib/gdb.exp (skip_libstdcxx_probe_tests_prompt): Return 1 if probe
+       * tests need to be skipped.
+       * gdb.cp/exceptprint.exp: Update call to skip_libstdcxx_probe_tests.
+       * gdb.mi/mi-catch-cpp-exceptions.exp: Update call to
+       mi_skip_libstdcxx_probe_tests.
+
 2019-08-26  Sergio Durigan Junior  <sergiodj@redhat.com>
 
        * gdb.python/py-xmethods.exp: Use raw strings when passing
index 46378d1b69b5337a5716c60440d9cd3dadb556c6..f6dcd0f5bdf9a43c1d2b41d114ea3ec1aaaf373f 100644 (file)
@@ -27,7 +27,7 @@ if {![runto_main]} {
     return -1
 }
 
-if {![skip_libstdcxx_probe_tests]} {
+if {[skip_libstdcxx_probe_tests]} {
     untested "could not find libstdc++ stap probe"
     return -1
 }
index 029dc1bd0258b54cc759ed8e1f6a4aada0ea64bf..29514978824162ade9f52a11c8ed3c627d980de6 100644 (file)
@@ -36,7 +36,7 @@ mi_gdb_load ${binfile}
 if {![mi_run_to_main]} {
     return -1
 }
-set libstdcxx_probe_tests_supported [mi_skip_libstdcxx_probe_tests]
+set libstdcxx_probe_tests_supported [expr ![mi_skip_libstdcxx_probe_tests]]
 
 # Grab some line numbers we'll need.
 set catch_1_lineno [gdb_get_line_number "Catch 1"]
index af56e8aa128e669c6d425c8a324d1cdfd77b8ec6..76805fb5ecd54ae3ac20f35dcc38e484616a9ba1 100644 (file)
@@ -3158,20 +3158,21 @@ proc skip_unwinder_tests {} {
     return $ok
 }
 
-# Return 0 if we should skip tests that require the libstdc++ stap
+# Return 1 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.  PROMPT_REGEXP is the expected prompt.
 
 proc skip_libstdcxx_probe_tests_prompt { prompt_regexp } {
-    set ok 0
+    set supported 0
     gdb_test_multiple "info probe" "check for stap probe in libstdc++" {
        -re ".*libstdcxx.*catch.*\r\n$prompt_regexp" {
-           set ok 1
+           set supported 1
        }
        -re "\r\n$prompt_regexp" {
        }
     } "$prompt_regexp"
-    return $ok
+    set skip [expr !$supported]
+    return $skip
 }
 
 # As skip_libstdcxx_probe_tests_prompt, with gdb_prompt.