From patchwork Mon Aug 26 16:51:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 34272 Received: (qmail 96002 invoked by alias); 26 Aug 2019 16:51:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 95990 invoked by uid 89); 26 Aug 2019 16:51:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Aug 2019 16:51:05 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 107E2AF0F; Mon, 26 Aug 2019 16:51:03 +0000 (UTC) Subject: [committed][gdb/testsuite] Make skip_libstdcxx_probe_tests return 1 if true To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org References: <20190725210447.GA26123@delia> <87h86410g2.fsf@redhat.com> From: Tom de Vries Openpgp: preference=signencrypt Message-ID: <7ad919e6-44ff-d9e4-5530-92fb87e452d8@suse.de> Date: Mon, 26 Aug 2019 18:51:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <87h86410g2.fsf@redhat.com> X-IsSubscribed: yes [ 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 [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 * 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.