From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MhWrCUYJbGJ2UwMAWB0awg (envelope-from ) for ; Fri, 29 Apr 2022 11:50:30 -0400 Received: by simark.ca (Postfix, from userid 112) id 1B62F1E058; Fri, 29 Apr 2022 11:50:30 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=lQfBGLe+; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 752A51E00D for ; Fri, 29 Apr 2022 11:50:29 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E31633856DC4 for ; Fri, 29 Apr 2022 15:50:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E31633856DC4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651247428; bh=EZQ9W6VqXUBtnKZ8vO2d+6FUL1SGubi43uMt2pGa1tY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=lQfBGLe+AS65dDHVClWKbCP/VS07HSdRzD+1J20uWOugcK/O2lEG4f8E79ZuSh9N3 X7oAiqQX0q7IcOhm0JdEhLEIdNeJ6Nnbi9mnYvQkvM4fMSLBAqHJrT7eR5tBEJOX4U tcV1YXvakIEJ48U1YNe4My3bB81RjRK+6cXvluC0= Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 01D4E385780C for ; Fri, 29 Apr 2022 15:50:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 01D4E385780C Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23TFIprh030917; Fri, 29 Apr 2022 15:48:06 GMT Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqtvxpt7u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 15:48:06 +0000 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23TFcaOY026248; Fri, 29 Apr 2022 15:48:05 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma04dal.us.ibm.com with ESMTP id 3fm93aw8tr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 15:48:05 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23TFm4iD12321180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Apr 2022 15:48:04 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41CD612405A; Fri, 29 Apr 2022 15:48:04 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 912DE12405C; Fri, 29 Apr 2022 15:48:03 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.152.172]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 29 Apr 2022 15:48:03 +0000 (GMT) Message-ID: <4610920e52ea1bbeb5181c970887eb7cfe344f1a.camel@us.ibm.com> To: Lancelot SIX , cel@us.ibm.com Date: Fri, 29 Apr 2022 08:48:02 -0700 In-Reply-To: <20220429091234.62xhprge74gfpgks@ubuntu.lan> References: <5ee342cd5f5272da9970da8a077c2c5209b85d6c.camel@us.ibm.com> <20220429091234.62xhprge74gfpgks@ubuntu.lan> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: DyjE2g97aPA1C4XYOtXZ4InRk_srgiPh X-Proofpoint-GUID: DyjE2g97aPA1C4XYOtXZ4InRk_srgiPh Subject: RE: [PATCH] Fix gdb.cp/no-dmgl-verbose.exp test X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-29_07,2022-04-28_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 clxscore=1011 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204290084 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: , From: Carl Love via Gdb-patches Reply-To: Carl Love Cc: Ulrich Weigand , gdb-patches@sourceware.org, Rogerio Alves Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On Fri, 2022-04-29 at 09:14 +0000, Lancelot SIX wrote: > > 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. True, as written I believe the period will match any character. > > > "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. Yes, on PowerPC I also see the same type File /usr/include/c++/11/bits/stringfwd.h: 79: typedef std::__cxx11::basic_string, std::allocator > std::string; > > 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)"… OK, I added the new test. It works as expected on PowerPC and on my Intel system. (gdb) PASS: gdb.cp/no-dmgl-verbose.exp: info types ^std::string$ break f(std::__cxx11::basic_string, std::allocator >) Breakpoint 1 at 0x10: file /home/carll/GDB/build-current/gdb/testsuite/../../../binutils-gdb-current/gdb/testsuite/gdb.cp/no-dmgl-verbose.cc, line 23. The additional test is good to have. The above suggested changes were tested on both PowerPC and Intel and pass as expected. Please let me know if the updated patch looks ok. 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 as given. The test was chaged to verify f(std::string) is not defined. An additional test was added to test setting a breakpoint using the actual string type. The test now runs correctly on Power 10 and Intel x86_64. --- gdb/testsuite/gdb.cp/no-dmgl-verbose.exp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.cp/no-dmgl-verbose.exp b/gdb/testsuite/gdb.cp/no-dmgl-verbose.exp index 14f11ddcf04..a18ab81318c 100644 --- a/gdb/testsuite/gdb.cp/no-dmgl-verbose.exp +++ b/gdb/testsuite/gdb.cp/no-dmgl-verbose.exp @@ -28,8 +28,17 @@ clean_restart ${testfile}.o gdb_test_no_output "set breakpoint pending off" -gdb_breakpoint {'f(std::string)'} +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 + } +} -gdb_test {break 'f(std::basic_string, std::allocator >)'} \ - {Function ".*" not defined\.} \ - "DMGL_VERBOSE-demangled f(std::string) is not defined" +if { $realtype != "" } { + gdb_breakpoint "f($realtype)" +} -- 2.31.1