From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4TuRK0KXlmGnUQAAWB0awg (envelope-from ) for ; Thu, 18 Nov 2021 13:11:14 -0500 Received: by simark.ca (Postfix, from userid 112) id A28051F0BF; Thu, 18 Nov 2021 13:11:14 -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 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 0CCD81E813 for ; Thu, 18 Nov 2021 13:11:14 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D8BF385AC26 for ; Thu, 18 Nov 2021 18:11:13 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2F35D385802D for ; Thu, 18 Nov 2021 18:10:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F35D385802D 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 635141E813; Thu, 18 Nov 2021 13:10:28 -0500 (EST) Subject: Re: [PATCH] gdb fix for catch-syscall.exp To: Carl Love , gdb-patches@sourceware.org References: <3b8e450b9fb4f4bec97a6bfbe6e6a4816be780ee.camel@us.ibm.com> From: Simon Marchi Message-ID: Date: Thu, 18 Nov 2021 13:10:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <3b8e450b9fb4f4bec97a6bfbe6e6a4816be780ee.camel@us.ibm.com> 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-17 6:30 p.m., Carl Love via Gdb-patches wrote: > GDB maintainers: > > The following patch fixes three test failures and an expect error. The > expect error ERROR: can't read "arch1": no such variable is the result > of the if/else statement in proc test_catch_syscall_multi_arch not > matching the power platform. The power platform, starting with Power > 8, has "le" in the platform string to indicate a Little Endian system. > The current expect string doesn't match the "le" in the name. > > The other three failures are the result of the execve instruction that > starts executing the new program. The expect script is looking for the > return from the execve command which doesn't occur since execve > replaces the current process image. > > The patch was tested on a Power 10 LE system with no regressions. > > Please let me know if the patch is acceptable for mainline. Thanks. > > Carl > > > ------------------------------------------------------------------- > gdb fix for catch-syscall.exp > > Remove check_continue "execve" from Proc test_catch_syscall_execve. > > The check_continue proceedure checs that the command, execve, starts and > checks for the return from the command. The execve command starts a new > program and thus the return from the command causing the test to fail. > > The call to proc check_continue "execve" is removed and replaced with > just the call to check_call_to_syscall "execve" to verify the command > executed. The next test in proc test_catch_syscall_execve verifies that > the new program started and hit the break point in main. > > Update the check for the PowerPC architecture. Power Little Endian systems > include "le" in the name. The istarget "power64-*-linux*" check fails to > match LE sytems. The expected string is updated to capture both Big Endian > and Little Endian systems. Power 10 LE istarget prints as: > powerpc64le-unknown-linux-gnu. > > This patch fixes three failures and the error: > > ERROR: can't read "arch1": no such variable > > Patch tested on Power 10 ppc64le GNU/Linux platform. > --- > gdb/testsuite/gdb.base/catch-syscall.exp | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp > index 811a92b0aea..8b496712df5 100644 > --- a/gdb/testsuite/gdb.base/catch-syscall.exp > +++ b/gdb/testsuite/gdb.base/catch-syscall.exp > @@ -348,7 +348,9 @@ 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" > + > + # check that the execve is called > + check_call_to_syscall "execve" > > # Continue to main so extended-remote can read files as needed. > # (Otherwise that "Reading" output confuses gdb_continue_to_end.) > @@ -550,7 +552,7 @@ proc test_catch_syscall_multi_arch {} { > set syscall2_name "write" > set syscall_number 1 > } elseif { [istarget "powerpc-*-linux*"] \ > - || [istarget "powerpc64-*-linux*"] } { > + || [istarget "powerpc64*-linux*"] } { > set arch1 "powerpc:common" > set arch2 "powerpc:common64" > set syscall1_name "openat" > -- > 2.30.2 > > Hi Carl, This patch causes this failure regression on Ubuntu 20.04, amd64: FAIL: gdb.base/catch-syscall.exp: execve: continue to main >From gdb.log: 615 continue^M 616 Continuing.^M 617 process 2022222 is executing new program: /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/catch-syscall/catch-syscall^M 618 ^M 619 Catchpoint 18 (returned from syscall execve), 0x00007ffff7fd0100 in _start () from /lib64/ld-linux-x86-64.so.2^M 620 (gdb) FAIL: gdb.base/catch-syscall.exp: execve: continue to main Simon