]> granicus.if.org Git - strace/commitdiff
Fix multiple personalities support in decoding syscall return values
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 28 Feb 2015 23:41:11 +0000 (23:41 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 28 Feb 2015 23:58:08 +0000 (23:58 +0000)
* syscall.c (trace_syscall_exiting): When current personality is 32bit,
print 32bit return code.

syscall.c

index 36c1254e1097a855d8d504c7e503a08cface385c..cfd16e72d0ef85dafa20e0b8c5a9c4cefa74689e 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -2450,7 +2450,13 @@ trace_syscall_exiting(struct tcb *tcp)
                else {
                        switch (sys_res & RVAL_MASK) {
                        case RVAL_HEX:
-                               tprintf("= %#lx", tcp->u_rval);
+#if SUPPORTED_PERSONALITIES > 1
+                               if (current_wordsize < sizeof(long))
+                                       tprintf("= %#x",
+                                               (unsigned int) tcp->u_rval);
+                               else
+#endif
+                                       tprintf("= %#lx", tcp->u_rval);
                                break;
                        case RVAL_OCTAL:
                                tprintf("= %#lo", tcp->u_rval);