extern int string_to_uint(const char *str);
extern int string_quote(const char *, char *, long, int);
-#if HAVE_LONG_LONG
-/* _l refers to the lower numbered u_arg,
- * _h refers to the higher numbered u_arg
+/* a refers to the lower numbered u_arg,
+ * b refers to the higher numbered u_arg
*/
-# if HAVE_LITTLE_ENDIAN_LONG_LONG
-# define LONG_LONG(_l,_h) \
- ((long long)((unsigned long long)(unsigned)(_l) | ((unsigned long long)(_h)<<32)))
-# else
-# define LONG_LONG(_l,_h) \
- ((long long)((unsigned long long)(unsigned)(_h) | ((unsigned long long)(_l)<<32)))
-# endif
-extern int printllval(struct tcb *, const char *, int);
+#if HAVE_LITTLE_ENDIAN_LONG_LONG
+# define LONG_LONG(a,b) \
+ ((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32)))
+#else
+# define LONG_LONG(a,b) \
+ ((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32)))
#endif
+extern int printllval(struct tcb *, const char *, int);
+
extern void printxval(const struct xlat *, int, const char *);
extern int printargs(struct tcb *);
extern int printargs_lu(struct tcb *);
tprintf("%#x /* %s */", val, dflt);
}
-#if HAVE_LONG_LONG
/*
* Print 64bit argument at position llarg and return the index of the next
* argument.
int
printllval(struct tcb *tcp, const char *format, int llarg)
{
-# if defined(X86_64) || defined(POWERPC64)
+#if defined(X86_64) || defined(POWERPC64)
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++;
} else {
-# ifdef POWERPC64
+# ifdef POWERPC64
/* Align 64bit argument to 64bit boundary. */
llarg = (llarg + 1) & 0x1e;
-# endif
+# endif
tprintf(format, LONG_LONG(tcp->u_arg[llarg], tcp->u_arg[llarg + 1]));
llarg += 2;
}
-# elif defined IA64 || defined ALPHA
+#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++;
-# elif defined LINUX_MIPSN32 || defined X32
+#elif defined LINUX_MIPSN32 || defined X32
tprintf(format, tcp->ext_arg[llarg]);
llarg++;
-# else
+#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;
-# endif
+#endif
return llarg;
}
-#endif
/*
* Interpret `xlat' as an array of flags