From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103299 invoked by alias); 26 Aug 2019 17:02:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 103290 invoked by uid 89); 26 Aug 2019 17:02:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Aug 2019 17:02:01 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94C53308FE8F; Mon, 26 Aug 2019 17:02:00 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66CEF196AE; Mon, 26 Aug 2019 17:02:00 +0000 (UTC) From: Sergio Durigan Junior To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [committed][gdb/testsuite] Make skip_libstdcxx_probe_tests return 1 if true References: <20190725210447.GA26123@delia> <87h86410g2.fsf@redhat.com> <7ad919e6-44ff-d9e4-5530-92fb87e452d8@suse.de> Date: Mon, 26 Aug 2019 17:02:00 -0000 In-Reply-To: <7ad919e6-44ff-d9e4-5530-92fb87e452d8@suse.de> (Tom de Vries's message of "Mon, 26 Aug 2019 18:51:02 +0200") Message-ID: <877e6z273r.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00596.txt.bz2 On Monday, August 26 2019, Tom de Vries wrote: > [ 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. Aha, thanks! > 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. > -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/