]> granicus.if.org Git - strace/commitdiff
S390: stop using needlessly static long pc variable
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 8 Feb 2013 14:50:05 +0000 (15:50 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 8 Feb 2013 14:50:05 +0000 (15:50 +0100)
* syscall.c: Remove "static long pc" variable.
(get_scno): Use an automatic long variable instead of a static.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
syscall.c

index fcd48505397a2ec2b6b80c4ad82352d21cceff30..a73651de188fa6fa7f0c47f50cc7f04661a3ad5f 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -705,7 +705,6 @@ static long a3;
 static long r2;
 #elif defined(S390) || defined(S390X)
 static long gpr2;
-static long pc;
 static long syscall_mode;
 #elif defined(HPPA)
 static long hppa_r28;
@@ -921,6 +920,7 @@ get_scno(struct tcb *tcp)
                /*
                 * Old style of "passing" the scno via the SVC instruction.
                 */
+               long psw;
                long opcode, offset_reg, tmp;
                void *svc_addr;
                static const int gpr_offset[16] = {
@@ -930,12 +930,12 @@ get_scno(struct tcb *tcp)
                                PT_GPR12, PT_GPR13, PT_GPR14,    PT_GPR15
                };
 
-               if (upeek(tcp, PT_PSWADDR, &pc) < 0)
+               if (upeek(tcp, PT_PSWADDR, &psw) < 0)
                        return -1;
                errno = 0;
-               opcode = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)(pc-sizeof(long)), 0);
+               opcode = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)(psw - sizeof(long)), 0);
                if (errno) {
-                       perror_msg("%s", "peektext(pc-oneword)");
+                       perror_msg("%s", "peektext(psw-oneword)");
                        return -1;
                }