From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 864963858010 for ; Fri, 29 Apr 2022 09:14:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 864963858010 Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 5B7A080D60; Fri, 29 Apr 2022 09:14:33 +0000 (UTC) Date: Fri, 29 Apr 2022 09:14:29 +0000 From: Lancelot SIX To: Carl Love Cc: gdb-patches@sourceware.org, Ulrich Weigand , Rogerio Alves Subject: Re: [PATCH] Fix gdb.cp/no-dmgl-verbose.exp test Message-ID: <20220429091234.62xhprge74gfpgks@ubuntu.lan> References: <5ee342cd5f5272da9970da8a077c2c5209b85d6c.camel@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5ee342cd5f5272da9970da8a077c2c5209b85d6c.camel@us.ibm.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Fri, 29 Apr 2022 09:14:33 +0000 (UTC) X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2022 09:14:36 -0000 Hi, Thanks for looking into it. On Thu, Apr 28, 2022 at 06:28:31PM -0700, Carl Love via Gdb-patches wrote: > > GDB maintainers: > > The gdb.cp/no-dmgl-verbose.exp test does a gdb_test which is not > written correctly. The test fails on both PowerPC and Intel. The > following patch update the gdb_test statement to the correct format. > The test now works correctly on PowerPC and Intel. > > Please let me know if the patch is acceptable for mainline. Thanks. > > Carl Love > > > ----------------------------------------------------------------------- > Fix gdb.cp/no-dmgl-verbose.exp test > > The test tries to check that setting a break point on f (std::string) fails > since the function is not defined. The test is not syntactically correct. > The test fails on both PowerPC and Intel. > > This patch fixes the test to set the breakpoint and verify that it fails > since the function is not defined. > > The test now runs correctly on Power 10 and Intel x86_64. > --- > gdb/testsuite/gdb.cp/no-dmgl-verbose.exp | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/gdb/testsuite/gdb.cp/no-dmgl-verbose.exp b/gdb/testsuite/gdb.cp/no-dmgl-verbose.exp > index 14f11ddcf04..d4ec88f3b6d 100644 > --- a/gdb/testsuite/gdb.cp/no-dmgl-verbose.exp > +++ b/gdb/testsuite/gdb.cp/no-dmgl-verbose.exp > @@ -28,8 +28,5 @@ clean_restart ${testfile}.o > > gdb_test_no_output "set breakpoint pending off" > > -gdb_breakpoint {'f(std::string)'} > - > -gdb_test {break 'f(std::basic_string, std::allocator >)'} \ > - {Function ".*" not defined\.} \ > +gdb_test "break 'f(std::string)'" ".*Function.*not defined." \ ^ I guess here the last . should be escaped (\.) otherwise has a special meaning for a regex. > "DMGL_VERBOSE-demangled f(std::string) is not defined" Also looks like that the test was testing that we can break on "f(std::string)", not "f($what_string_really_is)". This is not GDB's behaviour, as far as I can tell. To me GDB does the opposite. One can break using the full name of std::string, not "std::string". Also, on my system, std::string is in reality "std::__cxx11::basic_string, std::allocator >", not what is used in the test. I can test such behaviour with something like: gdb_test "break 'f(std::string)'" ".*Function.*not defined\." \ "f(std::string) is not defined" set realtype "" gdb_test_multiple "info types ^std::string$" "" { -re -wrap "typedef (\[^;\]*) std::string;" { set realtype $expect_out(1,string) pass $gdb_test_name } } if { $realtype != "" } { gdb_breakpoint "f($realtype)" } That being said, it would be nice to be able to place a breakpoint using "f(std::string)"… Best, Lancelot.