From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AEBNIt6xs2EqYAAAWB0awg (envelope-from ) for ; Fri, 10 Dec 2021 15:00:30 -0500 Received: by simark.ca (Postfix, from userid 112) id 8A0DC1EDEE; Fri, 10 Dec 2021 15:00:30 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 13E171EDEE for ; Fri, 10 Dec 2021 15:00:30 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5AF323857C44 for ; Fri, 10 Dec 2021 20:00:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AF323857C44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639166429; bh=Ln0yk+TIa0v7X1Hh4nrA6hru08ZYN0GBiAEJAtV3Ggk=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=VqC84Dz2nQF29C7uc0QwaUJ8IlveDBO3pLMvTO3sT156PvJYS8XGrunRV07ofWbTC zSZ8J4CWQzId7fTYVxUNemVjQP/F9O4x8wf/TwYzV4I3vPc+0+0YmFdGGE2PBVJ3Yb 8BNpOeva+8DaLPxUv/huWyjcYESbrk/uUV8w00CQ= Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 74657385801D for ; Fri, 10 Dec 2021 20:00:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 74657385801D Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BAJvlmm017273; Fri, 10 Dec 2021 19:59:57 GMT Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cvdgt810v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Dec 2021 19:59:57 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BAJwirq017378; Fri, 10 Dec 2021 19:59:56 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma01wdc.us.ibm.com with ESMTP id 3cqyycnwcn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Dec 2021 19:59:56 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BAJxtHG34472358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Dec 2021 19:59:55 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACA8111206B; Fri, 10 Dec 2021 19:59:55 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5ED7112067; Fri, 10 Dec 2021 19:59:54 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.83.168]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 10 Dec 2021 19:59:54 +0000 (GMT) Message-ID: <5644a7484e2b2024166cd7a7d091d11052f96cc6.camel@us.ibm.com> Subject: Re: [PATCH v2] gdb fix for catch-syscall.exp To: Simon Marchi , John Baldwin , gdb-patches@sourceware.org Date: Fri, 10 Dec 2021 11:59:54 -0800 In-Reply-To: <5f745078-cb28-86ae-1edd-bff0333283b6@simark.ca> References: <3b8e450b9fb4f4bec97a6bfbe6e6a4816be780ee.camel@us.ibm.com> <4d51616392553dd308672f65f18909ebf0513fc0.camel@us.ibm.com> <95fbffc3-8d30-6e75-4f52-f6e534a13b20@FreeBSD.org> <8269783078cecf5fe7fb7bea8d546256aafc7071.camel@us.ibm.com> <5f745078-cb28-86ae-1edd-bff0333283b6@simark.ca> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-16.el8) X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Za38vvLZxHIpTYP_QhDYzWJ5UR6CshKK X-Proofpoint-GUID: Za38vvLZxHIpTYP_QhDYzWJ5UR6CshKK Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-10_07,2021-12-10_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 mlxscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112100106 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: Rogerio Alves Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Simon: On Fri, 2021-12-10 at 13:36 -0500, Simon Marchi wrote: > > + -re -wrap ".*Breakpoint $decimal, main .*" { > > + # On Powerpc kernel does not report the returned from > > syscall > > + # as expected by the test. GDB bugzilla 28623. > > + xfail $thistest > > + return 0 > > This should check that the target is powerpc before doing the xfail, > because > getting that result on any other architecture should result in a > FAIL. Probably > "[istarget "powerpc*-*-*"]". > I added a check for istarget "powerpc64*-linux*". < snip> > > > > # Internal procedure that performs two 'continue' commands and > > checks if > > @@ -142,7 +159,11 @@ proc check_continue { syscall { pattern "" } } > > { > > # Testing if the inferior has called the syscall. > > check_call_to_syscall $syscall $pattern > > # And now, that the syscall has returned. > > - check_return_from_syscall $syscall $pattern > > + if [check_return_from_syscall $syscall $pattern] { > > + return 1 > > + } else { > > + return 0 > > + } > > Can this just be > > return [check_return_from_syscall $syscall $pattern] ? > Yup, that works for me. The updated patch is below. It has been retested on PowerPC and Intel with no new regressions. Please let me know if it is OK to commit to gdb mainline. Thanks. Carl ----------------------------------------------------- gdb: Powerpc mark xfail in gdb.base/catch-syscall.exp Powerpc is not reporting the Catchpoint 1 (returned from syscall execve), .... as expected. The issue appears to be with the kernel not returning the expected result. This patch marks the test failure as an xfail. See gdb bugzilla https://sourceware.org/bugzilla/show_bug.cgi?id=28623 --- gdb/testsuite/gdb.base/catch-syscall.exp | 38 ++++++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index cdd5e2aec47..76c5cfbc6d6 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -127,7 +127,29 @@ proc check_return_from_syscall { syscall { pattern "" } } { } set thistest "syscall $syscall has returned" - gdb_test "continue" "Catchpoint $decimal \\(returned from syscall ${pattern}\\).*" $thistest + if { $pattern eq "execve" } { + gdb_test_multiple "continue" $thistest { + -re -wrap "Catchpoint $decimal \\(returned from syscall ${pattern}\\).*" { + pass $thistest + return 1 + } + -re -wrap ".*Breakpoint $decimal, main .*" { + # On Powerpc kernel does not report the returned from syscall + # as expected by the test. GDB bugzilla 28623. + puts "CARLL test failed" + if { [istarget "powerpc64*-linux*"] } { + xfail $thistest + } else { + fail $thistest + } + return 0 + } + } + + } else { + gdb_test "continue" "Catchpoint $decimal \\(returned from syscall ${pattern}\\).*" $thistest + return 1 + } } # Internal procedure that performs two 'continue' commands and checks if @@ -142,7 +164,7 @@ proc check_continue { syscall { pattern "" } } { # Testing if the inferior has called the syscall. check_call_to_syscall $syscall $pattern # And now, that the syscall has returned. - check_return_from_syscall $syscall $pattern + return [check_return_from_syscall $syscall $pattern] } # Inserts a syscall catchpoint with an argument. @@ -348,11 +370,15 @@ proc test_catch_syscall_execve {} { # Check for entry/return across the execve, making sure that the # syscall_state isn't lost when turning into a new process. insert_catch_syscall_with_arg "execve" - check_continue "execve" + if [check_continue "execve"] { + # The check_continue test generates an XFAIL on Powerpc. In + # that case, gdb is already at main so don't do the continue. + - # Continue to main so extended-remote can read files as needed. - # (Otherwise that "Reading" output confuses gdb_continue_to_end.) - gdb_continue "main" + # Continue to main so extended-remote can read files as needed. + # (Otherwise that "Reading" output confuses gdb_continue_to_end.) + gdb_continue "main" + } # Now can we finish? check_for_program_end -- 2.30.2