[PULL v2 10/11] linux-user: strace: Fix 5th argument of futex syscall

deller@kernel.org posted 11 patches 1 day, 1 hour ago
Maintainers: Laurent Vivier <laurent@vivier.eu>
[PULL v2 10/11] linux-user: strace: Fix 5th argument of futex syscall
Posted by deller@kernel.org 1 day, 1 hour ago
From: Helge Deller <deller@gmx.de>

The 5th argument isn't printed, but instead the 4th argument is shown twice.
Fix this, and print the FUTEX_BITSET_MATCH_ANY string constant instead of -1
if the op is FUTEX_WAIT_BITSET or FUTEX_WAKE_BITSET.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/strace.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 18bc6c800c..ca67cfd09d 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -4150,7 +4150,12 @@ print_futex(CPUArchState *cpu_env, const struct syscallname *name,
             break;
     }
     print_pointer(arg4, 0);
-    print_raw_param("%d", arg4, 1);
+    if ((op == FUTEX_WAIT_BITSET || (op == FUTEX_WAKE_BITSET)) &&
+        (arg5 == FUTEX_BITSET_MATCH_ANY)) {
+        qemu_log("FUTEX_BITSET_MATCH_ANY");
+    } else {
+        print_raw_param("%#x", arg5, 1);
+    }
     print_syscall_epilogue(name);
 }
 #endif
-- 
2.52.0