From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EmQiBX7UeGJCOQUAWB0awg (envelope-from ) for ; Mon, 09 May 2022 04:44:46 -0400 Received: by simark.ca (Postfix, from userid 112) id 07E1C1E21F; Mon, 9 May 2022 04:44:46 -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=ixrAp9vT; 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 D8F041E00D for ; Mon, 9 May 2022 04:44:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E3E313856262 for ; Mon, 9 May 2022 08:44:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3E313856262 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652085883; bh=/0S0w7/qyHTS2FnIsnR5uvWpldm1tWebraGyNfinowA=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ixrAp9vTqm5U/6Mj/EG/tWLe4DTifecySoe3dM7rOKxTfzlvrN+7+cXt1x7Gg4CDq 0oeSKUd1OGjw+n9y+mRxenN8ErwC3BKxaEdLp6WMslEWMhgQHqFo3i/Hg1MhD9xH1l Q2AVRUewehHM7b9d0UJ5RFvsxXulNro71q5UFau4= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 45F893858427 for ; Mon, 9 May 2022 08:44:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 45F893858427 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4C7061FA06; Mon, 9 May 2022 08:44:23 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 37499132C0; Mon, 9 May 2022 08:44:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gValC2fUeGLDSgAAMHmgww (envelope-from ); Mon, 09 May 2022 08:44:23 +0000 Message-ID: Date: Mon, 9 May 2022 10:44:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: [committed][gdb/tdep] Handle pipe2 syscall for amd64 Content-Language: en-US To: gdb-patches@sourceware.org References: <20220503145716.GA26696@delia.home> In-Reply-To: <20220503145716.GA26696@delia.home> Content-Type: text/plain; charset=UTF-8; format=flowed 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/3/22 16:57, Tom de Vries wrote: > Hi, > > When running test-case gdb.reverse/pipe-reverse.exp on openSUSE Tumbleweed, > I run into: > ... > (gdb) continue^M > Continuing.^M > Process record and replay target doesn't support syscall number 293^M > Process record: failed to record execution log.^M > ^M > Program stopped.^M > 0x00007ffff7daabdb in pipe () from /lib64/libc.so.6^M > (gdb) FAIL: gdb.reverse/pipe-reverse.exp: continue to breakpoint: marker2 > ... > > The current glibc on Tumbleweed is 2.35, which contains commit > "linux: Implement pipe in terms of __NR_pipe2", and consequently syscall pipe2 > is used in stead of syscall pipe. > > There is already support added for syscall pipe2 for aarch64 (which only has > syscall pipe2, not syscall pipe), so enable the same for amd64, by: > - adding amd64_sys_pipe2 in enum amd64_syscall > - translating amd64_sys_pipe2 to gdb_sys_pipe2 in amd64_canonicalize_syscall > > Tested on x86_64-linux, specifically on: > - openSUSE Tumbleweed (with glibc 2.35), and > - openSUSE Leap 15.3 (with glibc 2.31). > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29056 > > Any comments? > Committed. Thanks, - Tom > [gdb/tdep] Handle pipe2 syscall for amd64 > > --- > gdb/amd64-linux-tdep.c | 3 +++ > gdb/amd64-linux-tdep.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c > index 0e5194fbeee..9a0759d639c 100644 > --- a/gdb/amd64-linux-tdep.c > +++ b/gdb/amd64-linux-tdep.c > @@ -460,6 +460,9 @@ amd64_canonicalize_syscall (enum amd64_syscall syscall_number) > case amd64_x32_sys_pipe: > return gdb_sys_pipe; > > + case amd64_sys_pipe2: > + return gdb_sys_pipe2; > + > case amd64_sys_select: > case amd64_x32_sys_select: > return gdb_sys_select; > diff --git a/gdb/amd64-linux-tdep.h b/gdb/amd64-linux-tdep.h > index 4a41b3b8245..184b0c86f07 100644 > --- a/gdb/amd64-linux-tdep.h > +++ b/gdb/amd64-linux-tdep.h > @@ -320,6 +320,7 @@ enum amd64_syscall { > amd64_sys_sync_file_range = 277, > amd64_sys_vmsplice = 278, > amd64_sys_move_pages = 279, > + amd64_sys_pipe2 = 293 > }; > > /* Enum that defines the syscall identifiers for x32 linux.