From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id s/JHFBlge2KPlgUAWB0awg (envelope-from ) for ; Wed, 11 May 2022 03:04:57 -0400 Received: by simark.ca (Postfix, from userid 112) id E77771E21F; Wed, 11 May 2022 03:04:56 -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=gxGKewyK; 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 DCDBA1E01D for ; Wed, 11 May 2022 03:04:55 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F32D6385700D for ; Wed, 11 May 2022 07:04:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F32D6385700D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652252695; bh=V3uLzSUh7m9oouW/t7GFXAMM+miwZhx13c2RqJJ/D0M=; 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=gxGKewyKAvlnhVmV8mLKkiTN397oixCVuAOrAf2BUIYTpPokS/fsWHBp3atk2FS0Q 2H4nWf6usTN3UGofF6D8kOTsCghWoWRLV7dnk2BjPmkn5BmG6eDrPkxq4TugJKlh3l EHIaCzF7BkVC4iAHqBTRztWEuhOn2l4/GZ3IcqKY= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 3DA1638515F7 for ; Wed, 11 May 2022 06:36:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3DA1638515F7 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-out1.suse.de (Postfix) with ESMTPS id 5C412210DF for ; Wed, 11 May 2022 06:36:26 +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 468A7139F9 for ; Wed, 11 May 2022 06:36:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vFytD2pZe2KzOgAAMHmgww (envelope-from ) for ; Wed, 11 May 2022 06:36:26 +0000 Message-ID: <91714371-682d-1383-85f9-b51bec4733fc@suse.de> Date: Wed, 11 May 2022 08:36:25 +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/record] Handle statx system call Content-Language: en-US To: gdb-patches@sourceware.org References: <20220509104058.GA20256@delia.home> In-Reply-To: <20220509104058.GA20256@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/9/22 12:41, Tom de Vries via Gdb-patches wrote: > Hi, > > When running test-case gdb.reverse/fstatat-reverse.exp with target board > unix/-m32 on openSUSE Tumbleweed, I run into: > ... > (gdb) PASS: gdb.reverse/fstatat-reverse.exp: set breakpoint at marker2 > continue^M > Continuing.^M > Process record and replay target doesn't support syscall number 383^M > Process record: failed to record execution log.^M > ^M > Program stopped.^M > 0xf7fc5555 in __kernel_vsyscall ()^M > (gdb) FAIL: gdb.reverse/fstatat-reverse.exp: continue to breakpoint: marker2 > ... > > The problems is that while with native we're trying to record these syscalls > (showing strace output): > ... > openat(AT_FDCWD, "/", O_RDONLY|O_PATH) = 3 > newfstatat(3, ".", {st_mode=S_IFDIR|0755, st_size=146, ...}, 0) = 0 > ... > with unix/-m32 we have instead: > ... > openat(AT_FDCWD, "/", O_RDONLY|O_PATH) = 3 > statx(3, ".", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, \ > {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=STATX_ATTR_MOUNT_ROOT, \ > stx_mode=S_IFDIR|0755, stx_size=146, ...}) = 0 > ... > and statx is not supported. > > Fix this by adding support for recording syscall statx. > > Tested on x86_64-linux. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28461 > > Any comments? > > Thanks, > - Tom > > [gdb/record] Handle statx system call > > --- > gdb/linux-record.c | 6 ++++++ > gdb/linux-record.h | 1 + > 2 files changed, 7 insertions(+) > > diff --git a/gdb/linux-record.c b/gdb/linux-record.c > index ea858df59a6..1e8e3c95567 100644 > --- a/gdb/linux-record.c > +++ b/gdb/linux-record.c > @@ -1046,6 +1046,12 @@ Do you want to stop the program?"), > return -1; > break; > > + case gdb_sys_statx: > + regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest); > + if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 256)) > + return -1; > + break; > + > case gdb_sys_uname: > if (record_mem_at_reg (regcache, tdep->arg1, > tdep->size_old_utsname)) > diff --git a/gdb/linux-record.h b/gdb/linux-record.h > index 07f0c5a2604..ab4c93cb870 100644 > --- a/gdb/linux-record.h > +++ b/gdb/linux-record.h > @@ -509,6 +509,7 @@ enum gdb_syscall { > gdb_sys_epoll_create1 = 329, > gdb_sys_dup3 = 330, > gdb_sys_pipe2 = 331, > + gdb_sys_statx = 383, > gdb_sys_inotify_init1 = 332, > gdb_sys_socket = 500, > gdb_sys_connect = 501, Committed, with this fixed: ... - gdb_sys_statx = 383, gdb_sys_inotify_init1 = 332, + gdb_sys_statx = 383, ... Thanks, - Tom