From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 17DD53856247; Wed, 11 May 2022 06:35:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17DD53856247 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/record] Handle statx system call X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 0dfdb5234a22308c5d1e732652eeee7fa6f608c7 X-Git-Newrev: d423425393e4ef27cabdda4134ae27905a18fcf7 Message-Id: <20220511063537.17DD53856247@sourceware.org> Date: Wed, 11 May 2022 06:35:37 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2022 06:35:37 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dd423425393e4= ef27cabdda4134ae27905a18fcf7 commit d423425393e4ef27cabdda4134ae27905a18fcf7 Author: Tom de Vries Date: Wed May 11 08:35:33 2022 +0200 [gdb/record] Handle statx system call =20 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: ma= rker2 ... =20 The problems is that while with native we're trying to record these sys= calls (showing strace output): ... openat(AT_FDCWD, "/", O_RDONLY|O_PATH) =3D 3 newfstatat(3, ".", {st_mode=3DS_IFDIR|0755, st_size=3D146, ...}, 0) =3D= 0 ... with unix/-m32 we have instead: ... openat(AT_FDCWD, "/", O_RDONLY|O_PATH) =3D 3 statx(3, ".", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_BASIC_STATS,= \ {stx_mask=3DSTATX_ALL|STATX_MNT_ID, stx_attributes=3DSTATX_ATTR_MOUNT= _ROOT, \ stx_mode=3DS_IFDIR|0755, stx_size=3D146, ...}) =3D 0 ... and statx is not supported. =20 Fix this by adding support for recording syscall statx. =20 Tested on x86_64-linux. =20 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28461 Diff: --- 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; =20 + 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..219c67f888d 100644 --- a/gdb/linux-record.h +++ b/gdb/linux-record.h @@ -510,6 +510,7 @@ enum gdb_syscall { gdb_sys_dup3 =3D 330, gdb_sys_pipe2 =3D 331, gdb_sys_inotify_init1 =3D 332, + gdb_sys_statx =3D 383, gdb_sys_socket =3D 500, gdb_sys_connect =3D 501, gdb_sys_accept =3D 502,