From: Denys Vlasenko Date: Mon, 1 Jul 2013 10:28:17 +0000 (+0200) Subject: Rename ia32 to ia64_ia32mode, and make it bool, not long X-Git-Tag: v4.9~209 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c09646aa9e8768d308267bb92747b2d1ff58b1c3;p=strace Rename ia32 to ia64_ia32mode, and make it bool, not long Grepping for just ia32 was turning up many false positives. Signed-off-by: Denys Vlasenko --- diff --git a/defs.h b/defs.h index 3b027e84..807a2904 100644 --- a/defs.h +++ b/defs.h @@ -381,7 +381,7 @@ struct arm_pt_regs { #if defined(I386) extern struct user_regs_struct i386_regs; #elif defined(IA64) -extern long ia32; +extern bool ia64_ia32mode; #elif defined(SPARC) || defined(SPARC64) extern struct pt_regs sparc_regs; #elif defined(ARM) diff --git a/syscall.c b/syscall.c index 105b28c9..d6f26927 100644 --- a/syscall.c +++ b/syscall.c @@ -720,7 +720,7 @@ static struct iovec x86_io = { .iov_base = &x86_regs_union }; #elif defined(IA64) -long ia32 = 0; /* not static */ +bool ia64_ia32mode = 0; /* not static */ static long ia64_r8, ia64_r10; #elif defined(POWERPC) struct pt_regs ppc_regs; @@ -1322,8 +1322,8 @@ get_scno(struct tcb *tcp) # define IA64_PSR_IS ((long)1 << 34) long psr; if (upeek(tcp->pid, PT_CR_IPSR, &psr) >= 0) - ia32 = (psr & IA64_PSR_IS) != 0; - if (ia32) { + ia64_ia32mode = ((psr & IA64_PSR_IS) != 0); + if (ia64_ia32mode) { if (upeek(tcp->pid, PT_R1, &scno) < 0) return -1; } else { @@ -1619,7 +1619,7 @@ syscall_fixup_on_sysenter(struct tcb *tcp) return -1; if (upeek(tcp->pid, PT_R8, &ia64_r8) < 0) return -1; - if (ia32 && ia64_r8 != -ENOSYS) { + if (ia64_ia32mode && ia64_r8 != -ENOSYS) { if (debug_flag) fprintf(stderr, "not a syscall entry (r8 = %ld)\n", ia64_r8); return 0; @@ -1745,7 +1745,7 @@ get_syscall_args(struct tcb *tcp) if (upeek(tcp->pid, REG_A0+i, &tcp->u_arg[i]) < 0) return -1; #elif defined(IA64) - if (!ia32) { + if (!ia64_ia32mode) { unsigned long *out0, cfm, sof, sol; long rbs_end; /* be backwards compatible with kernel < 2.4.4... */ @@ -2078,7 +2078,7 @@ get_syscall_result(struct tcb *tcp) # define IA64_PSR_IS ((long)1 << 34) long psr; if (upeek(tcp->pid, PT_CR_IPSR, &psr) >= 0) - ia32 = (psr & IA64_PSR_IS) != 0; + ia64_ia32mode = ((psr & IA64_PSR_IS) != 0); if (upeek(tcp->pid, PT_R8, &ia64_r8) < 0) return -1; if (upeek(tcp->pid, PT_R10, &ia64_r10) < 0) @@ -2264,7 +2264,7 @@ get_error(struct tcb *tcp) tcp->u_lrval = rax; } #elif defined(IA64) - if (ia32) { + if (ia64_ia32mode) { int err; err = (int)ia64_r8; diff --git a/util.c b/util.c index 8878ccf4..db376b33 100644 --- a/util.c +++ b/util.c @@ -1106,7 +1106,7 @@ arg_setup(struct tcb *tcp, arg_setup_state *state) unsigned long cfm, sof, sol; long bsp; - if (ia32) { + if (ia64_ia32mode) { /* Satisfy a false GCC warning. */ *state = NULL; return 0; @@ -1132,7 +1132,7 @@ get_arg0(struct tcb *tcp, arg_setup_state *state, long *valp) { int ret; - if (ia32) + if (ia64_ia32mode) ret = upeek(tcp->pid, PT_R11, valp); else ret = umoven(tcp, @@ -1146,7 +1146,7 @@ get_arg1(struct tcb *tcp, arg_setup_state *state, long *valp) { int ret; - if (ia32) + if (ia64_ia32mode) ret = upeek(tcp->pid, PT_R9, valp); else ret = umoven(tcp, @@ -1161,7 +1161,7 @@ set_arg0(struct tcb *tcp, arg_setup_state *state, long val) int req = PTRACE_POKEDATA; void *ap; - if (ia32) { + if (ia64_ia32mode) { ap = (void *) (intptr_t) PT_R11; /* r11 == EBX */ req = PTRACE_POKEUSER; } else @@ -1177,7 +1177,7 @@ set_arg1(struct tcb *tcp, arg_setup_state *state, long val) int req = PTRACE_POKEDATA; void *ap; - if (ia32) { + if (ia64_ia32mode) { ap = (void *) (intptr_t) PT_R9; /* r9 == ECX */ req = PTRACE_POKEUSER; } else @@ -1343,7 +1343,7 @@ change_syscall(struct tcb *tcp, arg_setup_state *state, int new) /* setbpt/clearbpt never used: */ /* Blackfin is only supported since about linux-2.6.23 */ #elif defined(IA64) - if (ia32) { + if (ia64_ia32mode) { switch (new) { case 2: break; /* x86 SYS_fork */