]> granicus.if.org Git - strace/commitdiff
M68K: Fix fetching syscall arguments
authorAndreas Schwab <schwab@linux-m68k.org>
Sat, 5 Jun 2010 19:50:30 +0000 (21:50 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Sat, 5 Jun 2010 19:50:30 +0000 (21:50 +0200)
* syscall.c (syscall_enter) [M68K]: Properly handle more than five
syscall arguments.

syscall.c

index 40eee3ac9bdede7d15d39fefb58a495f4722bfe1..ba2185c804bfb96095d8389e36d6d79c87b805c7 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -2249,6 +2249,18 @@ syscall_enter(struct tcb *tcp)
                                return -1;
                }
        }
+#elif defined (M68K)
+       {
+               int i;
+               if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1)
+                       tcp->u_nargs = sysent[tcp->scno].nargs;
+               else
+                       tcp->u_nargs = MAX_ARGS;
+               for (i = 0; i < tcp->u_nargs; i++) {
+                       if (upeek(tcp, (i < 5 ? i : i + 2)*4, &tcp->u_arg[i]) < 0)
+                               return -1;
+               }
+       }
 #else /* Other architecture (like i386) (32bits specific) */
        {
                int i;