On 8/26/22 07:18, Helge Deller wrote:
Signed-off-by: Helge Deller <del...@gmx.de>
---
  linux-user/strace.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index bac47748bc..a90e719681 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -3713,11 +3713,19 @@ print_futex(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)
  {
+#ifdef FUTEX_CMD_MASK
+    abi_long op = arg1 & FUTEX_CMD_MASK;
+#else
+    abi_long op = arg1;
+#endif

FUTEX_CMD_MASK is defined in syscall_def.h, so never undefined.

+    if (op == FUTEX_WAIT || op == FUTEX_WAIT_BITSET)
+        print_timespec(arg3, 0);
+    else
+        print_pointer(arg3, 0); /* struct timespec */

The else isn't quite correct -- the ops not listed, which actually use this parameter, treat it as uint32_t val2. Anyway, make this a switch, because I've implemented the other missing futex_ops, and several more treat use timespec.


r~

Reply via email to