]> git.pld-linux.org Git - packages/strace.git/blob - strace-sparc2.patch
- updated to 4.5.3 (better support for NPTL threads)
[packages/strace.git] / strace-sparc2.patch
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
4 @@ -75,7 +75,7 @@
5  #ifndef PTRACE_POKEUSR
6  # define PTRACE_POKEUSR PTRACE_POKEUSER
7  #endif
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
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
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;
41  
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;
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
57 @@ -62,9 +62,11 @@
58  # define PTRACE_PEEKUSR PTRACE_PEEKUSER
59  #endif
60  #elif defined(HAVE_LINUX_PTRACE_H)
61 +#ifndef __sparc__
62  #undef PTRACE_SYSCALL
63  #include <linux/ptrace.h>
64  #endif
65 +#endif
66  
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;
72  #elif defined (SPARC)
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 @@
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  
95 @@ -804,7 +806,7 @@
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  
104 @@ -812,10 +814,10 @@
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         }
117  #elif defined(HPPA)
118 @@ -1067,12 +1069,12 @@
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                 }
133  #else /* !SPARC */
134 @@ -1109,12 +1111,12 @@
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 */
150 @@ -1262,7 +1264,7 @@
151                 else 
152                         tcp->u_nargs = MAX_ARGS;
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         }
157  #elif defined (HPPA)
158         {
159 @@ -1715,10 +1717,10 @@
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  
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
176 @@ -44,7 +44,7 @@
177  #include <link.h>
178  #endif /* SUNOS4 */
179  
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>
183  #endif 
184  
This page took 0.10519 seconds and 3 git commands to generate.