[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 58/60] linux-user: Add strace for shmat
From: |
Richard Henderson |
Subject: |
[PATCH 58/60] linux-user: Add strace for shmat |
Date: |
Fri, 1 Mar 2024 13:06:17 -1000 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/strace.c | 24 ++++++++++++++++++++++++
linux-user/strace.list | 2 +-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index cf26e55264..8d13e55a5b 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -670,6 +670,26 @@ print_semctl(CPUArchState *cpu_env, const struct
syscallname *name,
}
#endif
+static void
+print_shmat(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)
+{
+ static const struct flags shmat_flags[] = {
+ FLAG_GENERIC(SHM_RND),
+ FLAG_GENERIC(SHM_REMAP),
+ FLAG_GENERIC(SHM_RDONLY),
+ FLAG_GENERIC(SHM_EXEC),
+ FLAG_END
+ };
+
+ print_syscall_prologue(name);
+ print_raw_param(TARGET_ABI_FMT_ld, arg0, 0);
+ print_pointer(arg1, 0);
+ print_flags(shmat_flags, arg2, 1);
+ print_syscall_epilogue(name);
+}
+
#ifdef TARGET_NR_ipc
static void
print_ipc(CPUArchState *cpu_env, const struct syscallname *name,
@@ -683,6 +703,10 @@ print_ipc(CPUArchState *cpu_env, const struct syscallname
*name,
print_ipc_cmd(arg3);
qemu_log(",0x" TARGET_ABI_FMT_lx ")", arg4);
break;
+ case IPCOP_shmat:
+ print_shmat(cpu_env, &(const struct syscallname){ .name = "shmat" },
+ arg1, arg4, arg2, 0, 0, 0);
+ break;
default:
qemu_log(("%s("
TARGET_ABI_FMT_ld ","
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 6655d4f26d..dfd4237d14 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1398,7 +1398,7 @@
{ TARGET_NR_sgetmask, "sgetmask" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_shmat
-{ TARGET_NR_shmat, "shmat" , NULL, NULL, print_syscall_ret_addr },
+{ TARGET_NR_shmat, "shmat" , NULL, print_shmat, print_syscall_ret_addr },
#endif
#ifdef TARGET_NR_shmctl
{ TARGET_NR_shmctl, "shmctl" , NULL, NULL, NULL },
--
2.34.1
- [PATCH 53/60] target/alpha: Enable TARGET_PAGE_BITS_VARY for user-only, (continued)
- [PATCH 53/60] target/alpha: Enable TARGET_PAGE_BITS_VARY for user-only, Richard Henderson, 2024/03/01
- [PATCH 60/60] tests/tcg: Check that shmat() does not break /proc/self/maps, Richard Henderson, 2024/03/01
- [PATCH 49/60] linux-user: Allow TARGET_PAGE_BITS_VARY, Richard Henderson, 2024/03/01
- [PATCH 56/60] linux-user/x86_64: Handle the vsyscall page in open_self_maps_{2, 4}, Richard Henderson, 2024/03/01
- [PATCH 43/60] linux-user: Split out mmap_h_gt_g, Richard Henderson, 2024/03/01
- [PATCH 44/60] tests/tcg: Remove run-test-mmap-*, Richard Henderson, 2024/03/01
- [PATCH 46/60] *-user: Deprecate and disable -p pagesize, Richard Henderson, 2024/03/01
- [PATCH 52/60] target/ppc: Enable TARGET_PAGE_BITS_VARY for user-only, Richard Henderson, 2024/03/01
- [PULL 00/60] linux-user and tcg patch queue, Richard Henderson, 2024/03/01
- [PATCH 54/60] linux-user: Remove pgb_dynamic alignment assertion, Richard Henderson, 2024/03/01
- [PATCH 58/60] linux-user: Add strace for shmat,
Richard Henderson <=
- Re: [PATCH 00/60] linux-user and tcg patch queue, Peter Maydell, 2024/03/05