1 diff -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
6 # define PTRACE_POKEUSR PTRACE_POKEUSER
8 -#elif defined(HAVE_LINUX_PTRACE_H)
9 +#elif defined(HAVE_LINUX_PTRACE_H) && !defined(SPARC)
11 #include <linux/ptrace.h>
13 diff -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
17 #ifndef PTRACE_POKEUSR
18 # define PTRACE_POKEUSR PTRACE_POKEUSER
20 -#elif defined(HAVE_LINUX_PTRACE_H)
21 +#elif defined(HAVE_LINUX_PTRACE_H) && !defined(SPARC)
23 #include <linux/ptrace.h>
26 #ifdef HAVE_ASM_SIGCONTEXT_H
29 - struct regs si_regs;
42 - if(ptrace(PTRACE_GETREGS, tcp->pid, (char *)®s, 0) < 0) {
43 + if(ptrace(PTRACE_GETREGS, tcp->pid, (char *)regs, 0) < 0) {
44 perror("sigreturn: PTRACE_GETREGS ");
50 + i1 = regs[REG_O6] + 24 * 4;
51 if(umove(tcp, i1, &si) < 0) {
52 perror("sigreturn: umove ");
54 diff -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
58 # define PTRACE_PEEKUSR PTRACE_PEEKUSER
60 #elif defined(HAVE_LINUX_PTRACE_H)
63 #include <linux/ptrace.h>
67 #if defined(LINUX) && defined(IA64)
68 # include <asm/ptrace_offsets.h>
73 - static struct regs regs;
74 + static gregset_t regs;
75 static unsigned long trap;
81 /* Everything we need is in the current register set. */
82 - if (ptrace(PTRACE_GETREGS,pid,(char *)®s,0) < 0)
83 + if (ptrace(PTRACE_GETREGS,pid,(char *)regs,0) < 0)
86 /* If we are entering, then disassemble the syscall trap. */
87 if (!(tcp->flags & TCB_INSYSCALL)) {
88 /* Retrieve the syscall trap instruction. */
90 - trap = ptrace(PTRACE_PEEKTEXT,pid,(char *)regs.r_pc,0);
91 + trap = ptrace(PTRACE_PEEKTEXT,pid,(char *)regs[REG_PC],0);
96 tcp->flags &= ~TCB_WAITEXECVE;
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]);
104 @@ -812,10 +814,10 @@
105 if (trap == 0x91d02027)
109 + scno = regs[REG_G1];
112 - memmove (®s.r_o0, ®s.r_o1, 7*sizeof(regs.r_o0));
113 + scno = regs[REG_O0];
114 + memmove (®s[REG_O0], ®s[REG_O1], 7*sizeof(regs[REG_O0]));
118 @@ -1067,12 +1069,12 @@
122 - if (regs.r_psr & PSR_C) {
123 + if (regs[REG_PSR] & PSR_C) {
125 - u_error = regs.r_o0;
126 + u_error = regs[REG_O0];
129 - tcp->u_rval = regs.r_o0;
130 + tcp->u_rval = regs[REG_O0];
134 @@ -1109,12 +1111,12 @@
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) {
141 - u_error = tcp->status.pr_reg[R_O0];
142 + u_error = tcp->status.pr_reg[REG_O0];
145 - tcp->u_rval = tcp->status.pr_reg[R_O0];
146 + tcp->u_rval = tcp->status.pr_reg[REG_O0];
150 @@ -1262,7 +1264,7 @@
152 tcp->u_nargs = MAX_ARGS;
153 for (i = 0; i < tcp->u_nargs; i++)
154 - tcp->u_arg[i] = *((®s.r_o0) + i);
155 + tcp->u_arg[i] = *((®s[REG_O0]) + i);
159 @@ -1715,10 +1717,10 @@
164 - if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)®s,0) < 0)
166 + if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)regs,0) < 0)
169 + val = regs[REG_O1];
173 diff -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
180 -#if defined(linux) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
181 +#if defined(linux) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)) && !defined(SPARC)
182 #include <linux/ptrace.h>