[PATCH] xtensa: always retrieve all syscall arguments

Chris Zankel chris at zankel.net
Mon May 6 22:17:55 UTC 2013


The number of arguments specified in syscallent.h does not include
registers that are skipped to align 64-bit arguments to even/odd
register pairs. So, always retrieve all registers used for arguments.

* syscall.c (get_syscall_args): always retrieve all syscall arguments

Signed-off-by: Chris Zankel <chris at zankel.net>
---
 syscall.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/syscall.c b/syscall.c
index 833dacd..522f446 100644
--- a/syscall.c
+++ b/syscall.c
@@ -1935,7 +1935,7 @@ get_syscall_args(struct tcb *tcp)
 #elif defined(XTENSA)
 	/* arg0: a6, arg1: a3, arg2: a4, arg3: a5, arg4: a8, arg5: a9 */
 	static const int xtensaregs[MAX_ARGS] = { 6, 3, 4, 5, 8, 9 };
-	for (i = 0; i < nargs; ++i)
+	for (i = 0; i < MAX_ARGS; ++i)
 		if (upeek(tcp, REG_A_BASE + xtensaregs[i], &tcp->u_arg[i]) < 0)
 			return -1;
 #else /* Other architecture (32bits specific) */
-- 
1.7.10.4





More information about the Strace-devel mailing list