]> granicus.if.org Git - strace/commitdiff
arm, aarch64, ppc: fix printllval-based decoders
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 3 May 2013 22:27:45 +0000 (22:27 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 3 May 2013 23:45:54 +0000 (23:45 +0000)
* util.c (printllval) [ARM || POWERPC]: Align argument number.
[AARCH64]: Align argument number in 32bit mode.
* file.c (sys_fadvise64_64) [ARM || POWERPC]: Remove no longer needed
printllval workaround.
[AARCH64]: Fix printing POSIX_FADV_* constants in 32bit mode.

file.c
util.c

diff --git a/file.c b/file.c
index 35f2b710f0347055c91bca9a0979e665a8960ff8..946446735c33ee312e5ea84244d2d4a58ea6d90f 100644 (file)
--- a/file.c
+++ b/file.c
@@ -2681,13 +2681,9 @@ sys_fadvise64_64(struct tcb *tcp)
        if (entering(tcp)) {
                int argn;
                printfd(tcp, tcp->u_arg[0]);
-#if defined ARM || defined POWERPC
-               argn = printllval(tcp, ", %lld, ", 2);
-#else
                argn = printllval(tcp, ", %lld, ", 1);
-#endif
                argn = printllval(tcp, "%lld, ", argn);
-#if defined ARM || defined POWERPC
+#if defined ARM || defined AARCH64 || defined POWERPC
                printxval(advise, tcp->u_arg[1], "POSIX_FADV_???");
 #else
                printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
diff --git a/util.c b/util.c
index eda6669260104739ff6b25571feafe822ef189f6..6f9f505731994c2d6a0fb13a2fe65afb27ff1dc6 100644 (file)
--- a/util.c
+++ b/util.c
@@ -186,8 +186,8 @@ printllval(struct tcb *tcp, const char *format, int arg_no)
                tprintf(format, tcp->u_arg[arg_no]);
                arg_no++;
        } else {
-# if defined(POWERPC64)
-               /* Align arg_no to next even number */
+# if defined(AARCH64) || defined(POWERPC64)
+               /* Align arg_no to the next even number. */
                arg_no = (arg_no + 1) & 0xe;
 # endif
                tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]));
@@ -215,6 +215,10 @@ printllval(struct tcb *tcp, const char *format, int arg_no)
 # if SIZEOF_LONG > 4
 #  error BUG: must not combine two args for long long on this arch
 # endif
+#if defined(ARM) || defined(POWERPC)
+       /* Align arg_no to the next even number. */
+       arg_no = (arg_no + 1) & 0xe;
+#endif
        tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]));
        arg_no += 2;
 #endif