From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2Op/De/veGIuPQUAWB0awg (envelope-from ) for ; Mon, 09 May 2022 06:41:51 -0400 Received: by simark.ca (Postfix, from userid 112) id 3471B1E21F; Mon, 9 May 2022 06:41:51 -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=fVGTiDUA; 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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 C17C91E00D for ; Mon, 9 May 2022 06:41:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2832F384B0CC for ; Mon, 9 May 2022 10:41:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2832F384B0CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652092910; bh=xggt4jj/R0Db4Daqu5olLtMQiqlX6/0XjlcBd3xKem8=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fVGTiDUA7BJPM/W7tiVTkLtHFNVmh8pFvUEBhoIuBwOghgr6glv4ieCNNMtNBuRLs QcklYRjAWdiEiXkisTZUqVvjqkQaRLlU48Gy/eqdpmW89uzC13EquzQIoIUUmoHEXK t2MkW/+t6c4qX7pkXgHCRIsShQqhf4cNGRb7+ouM= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 7F185385741D for ; Mon, 9 May 2022 10:41:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F185385741D 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 A4C0D1FA0B; Mon, 9 May 2022 10:41:01 +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 8B5BC132C0; Mon, 9 May 2022 10:41:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Kav4IL3veGLCBwAAMHmgww (envelope-from ); Mon, 09 May 2022 10:41:01 +0000 Date: Mon, 9 May 2022 12:41:00 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/record] Handle statx system call Message-ID: <20220509104058.GA20256@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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" 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,