diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2013-03-01 10:41:02 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-03-01 10:41:02 +0100 |
commit | 879ddddebab29211e495d99811cbd30a9eaf3055 (patch) | |
tree | 823ab8a400c37c3560dfe636dd513f5bc5524749 /util.c | |
parent | 22efaf0028ddec8f9ed2a2a11e9baaa201594a33 (diff) | |
download | strace-879ddddebab29211e495d99811cbd30a9eaf3055.tar.gz strace-879ddddebab29211e495d99811cbd30a9eaf3055.tar.bz2 strace-879ddddebab29211e495d99811cbd30a9eaf3055.tar.xz |
tile: handle printllval like x86_64 or powerpc64
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>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -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; } /* |