]> granicus.if.org Git - strace/commitdiff
tile: handle printllval like x86_64 or powerpc64
authorChris Metcalf <cmetcalf@tilera.com>
Fri, 1 Mar 2013 09:41:02 +0000 (10:41 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 1 Mar 2013 09:41:02 +0000 (10:41 +0100)
Without this fix the tilegx build fails when it hits the new #error
about SIZEOF_LONG > 4.

* util.c (printllval): Fix printing of long long values on TILE.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util.c

diff --git a/util.c b/util.c
index e14d2426a52f2e00c913cf262732fc8a35e218fc..34c1b6260b4fcffb016507cc9d2de0ef9d7b05e0 100644 (file)
--- a/util.c
+++ b/util.c
@@ -179,46 +179,46 @@ printxval(const struct xlat *xlat, int val, const char *dflt)
 }
 
 /*
- * Print 64bit argument at position llarg and return the index of the next
+ * Print 64bit argument at position arg_no and return the index of the next
  * argument.
  */
 int
-printllval(struct tcb *tcp, const char *format, int llarg)
+printllval(struct tcb *tcp, const char *format, int arg_no)
 {
-#if defined(X86_64) || defined(POWERPC64)
+#if defined(X86_64) || defined(POWERPC64) || defined(TILE)
        if (current_personality == 0) {
                /* Technically, format expects "long long",
                 * but we supply "long". We expect that
                 * on this arch, they are the same.
                 */
-               tprintf(format, tcp->u_arg[llarg]);
-               llarg++;
+               tprintf(format, tcp->u_arg[arg_no]);
+               arg_no++;
        } else {
-# ifdef POWERPC64
-               /* Align 64bit argument to 64bit boundary.  */
-               llarg = (llarg + 1) & 0x1e;
+# if defined(POWERPC64)
+               /* Align arg_no to next even number */
+               arg_no = (arg_no + 1) & 0xe;
 # endif
-               tprintf(format, LONG_LONG(tcp->u_arg[llarg], tcp->u_arg[llarg + 1]));
-               llarg += 2;
+               tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]));
+               arg_no += 2;
        }
 #elif defined IA64 || defined ALPHA
        /* Technically, format expects "long long",
         * but we supply "long". We expect that
         * on this arch, they are the same.
         */
-       tprintf(format, tcp->u_arg[llarg]);
-       llarg++;
+       tprintf(format, tcp->u_arg[arg_no]);
+       arg_no++;
 #elif defined LINUX_MIPSN32 || defined X32
-       tprintf(format, tcp->ext_arg[llarg]);
-       llarg++;
+       tprintf(format, tcp->ext_arg[arg_no]);
+       arg_no++;
 #else
 # if SIZEOF_LONG > 4
 #  error BUG: must not combine two args for long long on this arch
 # endif
-       tprintf(format, LONG_LONG(tcp->u_arg[llarg], tcp->u_arg[llarg + 1]));
-       llarg += 2;
+       tprintf(format, LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]));
+       arg_no += 2;
 #endif
-       return llarg;
+       return arg_no;
 }
 
 /*