aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-03-12 23:17:13 +0100
committerHelge Deller <deller@gmx.de>2023-07-08 16:55:08 +0200
commit036cf169a3484eeca5e17cfbee1f6988043ddd0e (patch)
tree500f27d7cb29fdfe817c1083c232cbfcf75b6934
parentdca4c8384d68bbf5d67f50a5446865d92d61f032 (diff)
downloadqemu-036cf169a3484eeca5e17cfbee1f6988043ddd0e.zip
qemu-036cf169a3484eeca5e17cfbee1f6988043ddd0e.tar.gz
qemu-036cf169a3484eeca5e17cfbee1f6988043ddd0e.tar.bz2
linux-user: Improve strace output of pread64() and pwrite64()
Make the strace look nicer for those two syscalls. Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--linux-user/strace.c19
-rw-r--r--linux-user/strace.list4
2 files changed, 21 insertions, 2 deletions
diff --git a/linux-user/strace.c b/linux-user/strace.c
index aad2b62..669200c 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -3999,6 +3999,25 @@ print_tgkill(CPUArchState *cpu_env, const struct syscallname *name,
}
#endif
+#if defined(TARGET_NR_pread64) || defined(TARGET_NR_pwrite64)
+static void
+print_pread64(CPUArchState *cpu_env, const struct syscallname *name,
+ abi_long arg0, abi_long arg1, abi_long arg2,
+ abi_long arg3, abi_long arg4, abi_long arg5)
+{
+ if (regpairs_aligned(cpu_env, TARGET_NR_pread64)) {
+ arg3 = arg4;
+ arg4 = arg5;
+ }
+ print_syscall_prologue(name);
+ print_raw_param("%d", arg0, 0);
+ print_pointer(arg1, 0);
+ print_raw_param("%d", arg2, 0);
+ print_raw_param("%" PRIu64, target_offset64(arg3, arg4), 1);
+ print_syscall_epilogue(name);
+}
+#endif
+
#ifdef TARGET_NR_statx
static void
print_statx(CPUArchState *cpu_env, const struct syscallname *name,
diff --git a/linux-user/strace.list b/linux-user/strace.list
index c7808ea..6655d4f 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1068,7 +1068,7 @@
{ TARGET_NR_prctl, "prctl" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_pread64
-{ TARGET_NR_pread64, "pread64" , NULL, NULL, NULL },
+{ TARGET_NR_pread64, "pread64" , NULL, print_pread64, NULL },
#endif
#ifdef TARGET_NR_preadv
{ TARGET_NR_preadv, "preadv" , NULL, NULL, NULL },
@@ -1099,7 +1099,7 @@
{ TARGET_NR_putpmsg, "putpmsg" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_pwrite64
-{ TARGET_NR_pwrite64, "pwrite64" , NULL, NULL, NULL },
+{ TARGET_NR_pwrite64, "pwrite64" , NULL, print_pread64, NULL },
#endif
#ifdef TARGET_NR_pwritev
{ TARGET_NR_pwritev, "pwritev" , NULL, NULL, NULL },