From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id M2wrEj2es2FfXAAAWB0awg (envelope-from ) for ; Fri, 10 Dec 2021 13:36:45 -0500 Received: by simark.ca (Postfix, from userid 112) id 379801F0D0; Fri, 10 Dec 2021 13:36:45 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 605761EDEE for ; Fri, 10 Dec 2021 13:36:44 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EE754385780E for ; Fri, 10 Dec 2021 18:36:43 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id ACA863858031 for ; Fri, 10 Dec 2021 18:36:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ACA863858031 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E26501EDEE; Fri, 10 Dec 2021 13:36:29 -0500 (EST) Subject: Re: [PATCH] gdb fix for catch-syscall.exp To: Carl Love , John Baldwin , gdb-patches@sourceware.org References: <3b8e450b9fb4f4bec97a6bfbe6e6a4816be780ee.camel@us.ibm.com> <4d51616392553dd308672f65f18909ebf0513fc0.camel@us.ibm.com> <95fbffc3-8d30-6e75-4f52-f6e534a13b20@FreeBSD.org> <8269783078cecf5fe7fb7bea8d546256aafc7071.camel@us.ibm.com> From: Simon Marchi Message-ID: <5f745078-cb28-86ae-1edd-bff0333283b6@simark.ca> Date: Fri, 10 Dec 2021 13:36:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit 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: , Cc: Rogerio Alves Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-11-29 11:46 a.m., Carl Love via Gdb-patches wrote: > Simon: > > I split the latest patch so there is a separate revert patch and a > patch to make the Powerepc test a xfail. Note, the revert patch only > reverts the part of the original patch that causes the regression test > on amd64. > > Let me know if the first patch looks OK to commit to mainline. > > We can continue to discuss the second patch to decide if there is a > better implementation to add the xfail and if it really is a kernel > failure. > > Carl > -------------------------------------------------------------------- > [PATCH 1/2] gdb: Revert change to gdb.base/catch-syscall.exp > > The previous commit: > commit ab198279120fe7937c0970a8bb881922726678f9 > Author: Carl Love > Date: Wed Nov 17 22:29:33 2021 +0000 > > gdb fix for catch-syscall.exp > > Fixed the test failure on PowerPC but broke the test on amd64. The issue is > both messages: > > Catchpoint 1 (call to syscall execve), .... > Catchpoint 1 (returned from syscall execve), .... > > are seen on amd64 whereas on PowerPC only the "call to syscall execve" is > seen. Based on the discussion on the mailing list, it is felt that this > is really an issue with the PowerPC kernel support not reporting both events. > > This patch just reverts the part of the commit that caused the regression > failure on amd64. The change for the istarget powerpc64-*-linux* is not > being reverted. > --- > gdb/testsuite/gdb.base/catch-syscall.exp | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp > index 016d0a698a6..cdd5e2aec47 100644 > --- a/gdb/testsuite/gdb.base/catch-syscall.exp > +++ b/gdb/testsuite/gdb.base/catch-syscall.exp > @@ -348,9 +348,7 @@ 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 that the execve is called. > - check_call_to_syscall "execve" > + check_continue "execve" > > # Continue to main so extended-remote can read files as needed. > # (Otherwise that "Reading" output confuses gdb_continue_to_end.) > -- > 2.30.2 This was already done by this commit: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e19f8248297bb9864ff14368cc89d2446572837a > diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp > index cdd5e2aec47..0693f7afe27 100644 > --- a/gdb/testsuite/gdb.base/catch-syscall.exp > +++ b/gdb/testsuite/gdb.base/catch-syscall.exp > @@ -127,7 +127,24 @@ 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. > + 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*-*-*"]". > + } > + } > + > + } 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 +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] ? Simon