]> git.pld-linux.org Git - packages/strace.git/blame - strace-sparc2.patch
- updated for 4.5.12
[packages/strace.git] / strace-sparc2.patch
CommitLineData
ed799d14
AM
1diff -urN strace-4.3.org/process.c strace-4.3/process.c
2--- strace-4.3.org/process.c Wed Apr 4 19:25:52 2001
3+++ strace-4.3/process.c Wed Apr 4 21:07:52 2001
4@@ -75,7 +75,7 @@
5 #ifndef PTRACE_POKEUSR
6 # define PTRACE_POKEUSR PTRACE_POKEUSER
de4e0a62 7 #endif
ed799d14
AM
8-#elif defined(HAVE_LINUX_PTRACE_H)
9+#elif defined(HAVE_LINUX_PTRACE_H) && !defined(SPARC)
10 #undef PTRACE_SYSCALL
11 #include <linux/ptrace.h>
12 #endif
13diff -urN strace-4.3.org/signal.c strace-4.3/signal.c
14--- strace-4.3.org/signal.c Wed Apr 4 19:25:52 2001
15+++ strace-4.3/signal.c Wed Apr 4 21:07:52 2001
16@@ -51,7 +51,7 @@
17 #ifndef PTRACE_POKEUSR
18 # define PTRACE_POKEUSR PTRACE_POKEUSER
19 #endif
20-#elif defined(HAVE_LINUX_PTRACE_H)
21+#elif defined(HAVE_LINUX_PTRACE_H) && !defined(SPARC)
22 #undef PTRACE_SYSCALL
23 #include <linux/ptrace.h>
24 #endif
25@@ -80,7 +80,7 @@
26 #ifdef HAVE_ASM_SIGCONTEXT_H
27 #ifdef SPARC
28 typedef struct {
29- struct regs si_regs;
30+ gregset_t si_regs;
31 int si_mask;
32 } m_siginfo_t;
33 #else
34@@ -899,16 +899,16 @@
35 #else
36 #ifdef SPARC
37 long i1;
38- struct regs regs;
39+ gregset_t regs;
40 m_siginfo_t si;
de4e0a62 41
ed799d14
AM
42- if(ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0) {
43+ if(ptrace(PTRACE_GETREGS, tcp->pid, (char *)regs, 0) < 0) {
44 perror("sigreturn: PTRACE_GETREGS ");
45 return 0;
46 }
47 if(entering(tcp)) {
48 tcp->u_arg[0] = 0;
49- i1 = regs.r_o1;
50+ i1 = regs[REG_O6] + 24 * 4;
51 if(umove(tcp, i1, &si) < 0) {
52 perror("sigreturn: umove ");
53 return 0;
54diff -urN strace-4.3.org/syscall.c strace-4.3/syscall.c
55--- strace-4.3.org/syscall.c Wed Apr 4 19:25:52 2001
56+++ strace-4.3/syscall.c Wed Apr 4 21:08:28 2001
57@@ -62,9 +62,11 @@
58 # define PTRACE_PEEKUSR PTRACE_PEEKUSER
59 #endif
60 #elif defined(HAVE_LINUX_PTRACE_H)
de4e0a62
JR
61+#ifndef __sparc__
62 #undef PTRACE_SYSCALL
63 #include <linux/ptrace.h>
ed799d14 64 #endif
de4e0a62 65+#endif
de4e0a62 66
ed799d14
AM
67 #if defined(LINUX) && defined(IA64)
68 # include <asm/ptrace_offsets.h>
69@@ -635,7 +637,7 @@
70 static long r0;
71 static long a3;
de4e0a62 72 #elif defined (SPARC)
ed799d14
AM
73- static struct regs regs;
74+ static gregset_t regs;
75 static unsigned long trap;
76 #elif defined(MIPS)
77 static long a3;
78@@ -761,14 +763,14 @@
de4e0a62
JR
79 }
80 #elif defined (SPARC)
81 /* Everything we need is in the current register set. */
82- if (ptrace(PTRACE_GETREGS,pid,(char *)&regs,0) < 0)
83+ if (ptrace(PTRACE_GETREGS,pid,(char *)regs,0) < 0)
84 return -1;
85
86 /* If we are entering, then disassemble the syscall trap. */
87 if (!(tcp->flags & TCB_INSYSCALL)) {
88 /* Retrieve the syscall trap instruction. */
89 errno = 0;
90- trap = ptrace(PTRACE_PEEKTEXT,pid,(char *)regs.r_pc,0);
91+ trap = ptrace(PTRACE_PEEKTEXT,pid,(char *)regs[REG_PC],0);
92 if (errno)
93 return -1;
94
ed799d14 95@@ -804,7 +806,7 @@
de4e0a62
JR
96 tcp->flags &= ~TCB_WAITEXECVE;
97 return 0;
98 }
99- fprintf(stderr,"syscall: unknown syscall trap %08x %08x\n", trap, regs.r_pc);
100+ fprintf(stderr,"syscall: unknown syscall trap %08x %08x\n", trap, regs[REG_PC]);
101 return -1;
102 }
103
ed799d14 104@@ -812,10 +814,10 @@
de4e0a62
JR
105 if (trap == 0x91d02027)
106 scno = 156;
107 else
108- scno = regs.r_g1;
109+ scno = regs[REG_G1];
110 if (scno == 0) {
111- scno = regs.r_o0;
112- memmove (&regs.r_o0, &regs.r_o1, 7*sizeof(regs.r_o0));
113+ scno = regs[REG_O0];
114+ memmove (&regs[REG_O0], &regs[REG_O1], 7*sizeof(regs[REG_O0]));
115 }
116 }
ed799d14
AM
117 #elif defined(HPPA)
118@@ -1067,12 +1069,12 @@
de4e0a62
JR
119 }
120 #else /* !ALPHA */
121 #ifdef SPARC
122- if (regs.r_psr & PSR_C) {
123+ if (regs[REG_PSR] & PSR_C) {
124 tcp->u_rval = -1;
125- u_error = regs.r_o0;
126+ u_error = regs[REG_O0];
127 }
128 else {
129- tcp->u_rval = regs.r_o0;
130+ tcp->u_rval = regs[REG_O0];
131 u_error = 0;
132 }
ed799d14
AM
133 #else /* !SPARC */
134@@ -1109,12 +1111,12 @@
de4e0a62
JR
135 #ifdef SVR4
136 #ifdef SPARC
137 /* Judicious guessing goes a long way. */
138- if (tcp->status.pr_reg[R_PSR] & 0x100000) {
139+ if (tcp->status.pr_reg[REG_PSR] & 0x100000) {
140 tcp->u_rval = -1;
141- u_error = tcp->status.pr_reg[R_O0];
142+ u_error = tcp->status.pr_reg[REG_O0];
143 }
144 else {
145- tcp->u_rval = tcp->status.pr_reg[R_O0];
146+ tcp->u_rval = tcp->status.pr_reg[REG_O0];
147 u_error = 0;
148 }
149 #endif /* SPARC */
ed799d14
AM
150@@ -1262,7 +1264,7 @@
151 else
152 tcp->u_nargs = MAX_ARGS;
de4e0a62
JR
153 for (i = 0; i < tcp->u_nargs; i++)
154- tcp->u_arg[i] = *((&regs.r_o0) + i);
155+ tcp->u_arg[i] = *((&regs[REG_O0]) + i);
156 }
ed799d14 157 #elif defined (HPPA)
de4e0a62 158 {
ed799d14 159@@ -1715,10 +1717,10 @@
de4e0a62
JR
160
161 #ifdef LINUX
162 #ifdef SPARC
163- struct regs regs;
164- if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)&regs,0) < 0)
165+ gregset_t regs;
166+ if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)regs,0) < 0)
167 return -1;
168- val = regs.r_o1;
169+ val = regs[REG_O1];
170 #endif /* SPARC */
171 #endif /* LINUX */
172
ed799d14
AM
173diff -urN strace-4.3.org/util.c strace-4.3/util.c
174--- strace-4.3.org/util.c Wed Apr 4 19:25:52 2001
175+++ strace-4.3/util.c Wed Apr 4 21:07:52 2001
de4e0a62
JR
176@@ -44,7 +44,7 @@
177 #include <link.h>
178 #endif /* SUNOS4 */
179
ed799d14
AM
180-#if defined(linux) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
181+#if defined(linux) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)) && !defined(SPARC)
de4e0a62
JR
182 #include <linux/ptrace.h>
183 #endif
de4e0a62 184
This page took 0.079001 seconds and 4 git commands to generate.