From: Tom de Vries <tdevries@suse.de>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Make skip_libstdcxx_probe_tests return 1 if true
Date: Mon, 26 Aug 2019 16:51:00 -0000 [thread overview]
Message-ID: <7ad919e6-44ff-d9e4-5530-92fb87e452d8@suse.de> (raw)
In-Reply-To: <87h86410g2.fsf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 426 bytes --]
[ was: Re: [PATCH][gdb, c++] Improve error message when using libstdcxx
without SDT probes ]
On 26-08-19 16:11, Sergio Durigan Junior wrote:
>> +set libstdcxx_probe_tests_supported [skip_libstdcxx_probe_tests]
> Not your fault, but this reversed logic (skip_libstdcxx_probe_tests
> returns 0 if the tests should be skipped) is kinda confusing.
>
It's also confusing me.
Fixed in attached patch.
Committed.
Thanks,
- Tom
[-- Attachment #2: 0001-gdb-testsuite-Make-skip_libstdcxx_probe_tests-return-1-if-true.patch --]
[-- Type: text/x-patch, Size: 2878 bytes --]
[gdb/testsuite] Make skip_libstdcxx_probe_tests return 1 if true
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/gdb.cp/exceptprint.exp | 2 +-
gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp | 2 +-
gdb/testsuite/lib/gdb.exp | 9 +++++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/gdb/testsuite/gdb.cp/exceptprint.exp b/gdb/testsuite/gdb.cp/exceptprint.exp
index 46378d1b69..f6dcd0f5bd 100644
--- a/gdb/testsuite/gdb.cp/exceptprint.exp
+++ b/gdb/testsuite/gdb.cp/exceptprint.exp
@@ -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
}
diff --git a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
index 029dc1bd02..2951497882 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
+++ b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
@@ -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"]
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index af56e8aa12..76805fb5ec 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -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.
next prev parent reply other threads:[~2019-08-26 16:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 21:04 [PATCH][gdb, c++] Improve error message when using libstdcxx without SDT probes Tom de Vries
2019-07-26 21:00 ` Tom Tromey
2019-08-13 13:51 ` [PING][PATCH][gdb, " Tom de Vries
2019-08-26 8:47 ` [PING^2][PATCH][gdb, " Tom de Vries
2019-08-26 14:11 ` [PATCH][gdb, " Sergio Durigan Junior
2019-08-26 16:51 ` Tom de Vries [this message]
2019-08-26 17:02 ` [committed][gdb/testsuite] Make skip_libstdcxx_probe_tests return 1 if true Sergio Durigan Junior
2019-08-26 17:27 ` [PATCH][gdb, c++] Improve error message when using libstdcxx without SDT probes Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7ad919e6-44ff-d9e4-5530-92fb87e452d8@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox