From d93d9f8d7f8d889eff14307983fc77ba2b023555 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 28 Feb 2015 23:41:11 +0000 Subject: [PATCH] Fix multiple personalities support in decoding syscall return values * syscall.c (trace_syscall_exiting): When current personality is 32bit, print 32bit return code. --- syscall.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.40.0