From: Dmitry V. Levin Date: Sat, 28 Feb 2015 23:41:11 +0000 (+0000) Subject: Fix multiple personalities support in decoding syscall return values X-Git-Tag: v4.10~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d93d9f8d7f8d889eff14307983fc77ba2b023555;p=strace Fix multiple personalities support in decoding syscall return values * syscall.c (trace_syscall_exiting): When current personality is 32bit, print 32bit return code. --- diff --git a/syscall.c b/syscall.c index 36c1254e..cfd16e72 100644 --- 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);