]>
Commit | Line | Data |
---|---|---|
de4e0a62 JR |
1 | --- strace-4.2/linux/sparc/syscall.h.jj Tue May 23 06:23:31 2000 |
2 | +++ strace-4.2/linux/sparc/syscall.h Wed May 24 06:08:08 2000 | |
3 | @@ -36,7 +36,7 @@ int sys_errsys(); | |
4 | /* 1.1 processes and protection */ | |
5 | int sys_gethostid(),sys_sethostname(),sys_gethostname(),sys_getpid(); | |
6 | int sys_setdomainname(),sys_getdomainname(); | |
7 | -int sys_fork(),sys_exit(),sys_execv(),sys_execve(),sys_wait4(),sys_waitpid(); | |
8 | +int sys_fork(),sys_exit(),sys_clone(),sys_execv(),sys_execve(),sys_wait4(),sys_waitpid(); | |
9 | int sys_setuid(),sys_setgid(),sys_getuid(),sys_setreuid(),sys_getgid(),sys_getgroups(),sys_setregid(),sys_setgroups(); | |
10 | int sys_getpgrp(),sys_setpgrp(); | |
11 | int sys_setsid(), sys_setpgid(); | |
12 | --- strace-4.2/syscall.c.jj Tue May 23 06:23:31 2000 | |
13 | +++ strace-4.2/syscall.c Wed May 24 10:18:49 2000 | |
14 | @@ -43,12 +43,16 @@ | |
15 | #include <sys/param.h> | |
16 | ||
17 | #if HAVE_ASM_REG_H | |
18 | +#ifndef __sparc__ | |
19 | #include <asm/reg.h> | |
20 | #endif | |
21 | +#endif | |
22 | ||
23 | #if HAVE_LINUX_PTRACE_H | |
24 | +#ifndef __sparc__ | |
25 | #undef PTRACE_SYSCALL | |
26 | #include <linux/ptrace.h> | |
27 | +#endif | |
28 | #endif | |
29 | ||
30 | #ifdef HAVE_SYS_REG_H | |
31 | @@ -561,7 +565,7 @@ struct tcb *tcp; | |
32 | #elif defined(MIPS) | |
33 | long r2,a3; | |
34 | #elif defined (SPARC) | |
35 | - struct regs regs; | |
36 | + gregset_t regs; | |
37 | unsigned long trap; | |
38 | #elif defined(S390) | |
39 | long gpr2; | |
40 | @@ -677,14 +681,14 @@ struct tcb *tcp; | |
41 | } | |
42 | #elif defined (SPARC) | |
43 | /* Everything we need is in the current register set. */ | |
44 | - if (ptrace(PTRACE_GETREGS,pid,(char *)®s,0) < 0) | |
45 | + if (ptrace(PTRACE_GETREGS,pid,(char *)regs,0) < 0) | |
46 | return -1; | |
47 | ||
48 | /* If we are entering, then disassemble the syscall trap. */ | |
49 | if (!(tcp->flags & TCB_INSYSCALL)) { | |
50 | /* Retrieve the syscall trap instruction. */ | |
51 | errno = 0; | |
52 | - trap = ptrace(PTRACE_PEEKTEXT,pid,(char *)regs.r_pc,0); | |
53 | + trap = ptrace(PTRACE_PEEKTEXT,pid,(char *)regs[REG_PC],0); | |
54 | if (errno) | |
55 | return -1; | |
56 | ||
57 | @@ -720,7 +724,7 @@ struct tcb *tcp; | |
58 | tcp->flags &= ~TCB_WAITEXECVE; | |
59 | return 0; | |
60 | } | |
61 | - fprintf(stderr,"syscall: unknown syscall trap %08x %08x\n", trap, regs.r_pc); | |
62 | + fprintf(stderr,"syscall: unknown syscall trap %08x %08x\n", trap, regs[REG_PC]); | |
63 | return -1; | |
64 | } | |
65 | ||
66 | @@ -728,10 +732,10 @@ struct tcb *tcp; | |
67 | if (trap == 0x91d02027) | |
68 | scno = 156; | |
69 | else | |
70 | - scno = regs.r_g1; | |
71 | + scno = regs[REG_G1]; | |
72 | if (scno == 0) { | |
73 | - scno = regs.r_o0; | |
74 | - memmove (®s.r_o0, ®s.r_o1, 7*sizeof(regs.r_o0)); | |
75 | + scno = regs[REG_O0]; | |
76 | + memmove (®s[REG_O0], ®s[REG_O1], 7*sizeof(regs[REG_O0])); | |
77 | } | |
78 | } | |
79 | #endif | |
80 | @@ -917,12 +921,12 @@ struct tcb *tcp; | |
81 | } | |
82 | #else /* !ALPHA */ | |
83 | #ifdef SPARC | |
84 | - if (regs.r_psr & PSR_C) { | |
85 | + if (regs[REG_PSR] & PSR_C) { | |
86 | tcp->u_rval = -1; | |
87 | - u_error = regs.r_o0; | |
88 | + u_error = regs[REG_O0]; | |
89 | } | |
90 | else { | |
91 | - tcp->u_rval = regs.r_o0; | |
92 | + tcp->u_rval = regs[REG_O0]; | |
93 | u_error = 0; | |
94 | } | |
95 | #endif /* SPARC */ | |
96 | @@ -947,12 +951,12 @@ struct tcb *tcp; | |
97 | #ifdef SVR4 | |
98 | #ifdef SPARC | |
99 | /* Judicious guessing goes a long way. */ | |
100 | - if (tcp->status.pr_reg[R_PSR] & 0x100000) { | |
101 | + if (tcp->status.pr_reg[REG_PSR] & 0x100000) { | |
102 | tcp->u_rval = -1; | |
103 | - u_error = tcp->status.pr_reg[R_O0]; | |
104 | + u_error = tcp->status.pr_reg[REG_O0]; | |
105 | } | |
106 | else { | |
107 | - tcp->u_rval = tcp->status.pr_reg[R_O0]; | |
108 | + tcp->u_rval = tcp->status.pr_reg[REG_O0]; | |
109 | u_error = 0; | |
110 | } | |
111 | #endif /* SPARC */ | |
112 | @@ -1185,7 +1189,7 @@ struct tcb *tcp; | |
113 | ||
114 | tcp->u_nargs = sysent[tcp->scno].nargs; | |
115 | for (i = 0; i < tcp->u_nargs; i++) | |
116 | - tcp->u_arg[i] = *((®s.r_o0) + i); | |
117 | + tcp->u_arg[i] = *((®s[REG_O0]) + i); | |
118 | } | |
119 | #else | |
120 | { | |
121 | @@ -1399,10 +1403,10 @@ struct tcb *tcp; | |
122 | ||
123 | #ifdef LINUX | |
124 | #ifdef SPARC | |
125 | - struct regs regs; | |
126 | - if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)®s,0) < 0) | |
127 | + gregset_t regs; | |
128 | + if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)regs,0) < 0) | |
129 | return -1; | |
130 | - val = regs.r_o1; | |
131 | + val = regs[REG_O1]; | |
132 | #endif /* SPARC */ | |
133 | #endif /* LINUX */ | |
134 | ||
135 | --- strace-4.2/util.c.jj Tue May 23 06:23:31 2000 | |
136 | +++ strace-4.2/util.c Wed May 24 10:19:30 2000 | |
137 | @@ -44,7 +44,7 @@ | |
138 | #include <link.h> | |
139 | #endif /* SUNOS4 */ | |
140 | ||
141 | -#if defined(linux) | |
142 | +#if defined(linux) && !defined(SPARC) | |
143 | #include <linux/ptrace.h> | |
144 | #endif | |
145 | ||
146 | --- strace-4.2/process.c.jj Tue May 23 06:23:31 2000 | |
147 | +++ strace-4.2/process.c Wed May 24 10:20:33 2000 | |
148 | @@ -49,7 +49,7 @@ | |
149 | #include <machine/reg.h> | |
150 | #endif /* SUNOS4 */ | |
151 | ||
152 | -#if HAVE_LINUX_PTRACE_H | |
153 | +#if HAVE_LINUX_PTRACE_H && !defined(SPARC) | |
154 | #undef PTRACE_SYSCALL | |
155 | #include <linux/ptrace.h> | |
156 | #endif | |
157 | --- strace-4.2/signal.c.jj Tue May 23 06:23:31 2000 | |
158 | +++ strace-4.2/signal.c Wed May 24 11:02:15 2000 | |
159 | @@ -43,7 +43,7 @@ | |
160 | #include <sys/ucontext.h> | |
161 | #endif /* SVR4 */ | |
162 | ||
163 | -#if HAVE_LINUX_PTRACE_H | |
164 | +#if HAVE_LINUX_PTRACE_H && !defined(SPARC) | |
165 | #undef PTRACE_SYSCALL | |
166 | #include <linux/ptrace.h> | |
167 | #endif | |
168 | @@ -64,15 +64,14 @@ | |
169 | # include <asm/ptrace_offsets.h> | |
170 | #endif /* !IA64 */ | |
171 | ||
172 | -#ifdef HAVE_ASM_SIGCONTEXT_H | |
173 | -#include <asm/sigcontext.h> | |
174 | #ifdef SPARC | |
175 | -#include <asm/reg.h> | |
176 | typedef struct { | |
177 | - struct regs si_regs; | |
178 | + gregset_t si_regs; | |
179 | int si_mask; | |
180 | } m_siginfo_t; | |
181 | #endif | |
182 | +#if defined HAVE_ASM_SIGCONTEXT_H && !defined(SPARC) | |
183 | +#include <asm/sigcontext.h> | |
184 | #else /* !HAVE_ASM_SIGCONTEXT_H */ | |
185 | #ifdef I386 | |
186 | struct sigcontext_struct { | |
187 | @@ -841,16 +840,16 @@ struct tcb *tcp; | |
188 | #else | |
189 | #ifdef SPARC | |
190 | long i1; | |
191 | - struct regs regs; | |
192 | + gregset_t regs; | |
193 | m_siginfo_t si; | |
194 | ||
195 | - if(ptrace(PTRACE_GETREGS, tcp->pid, (char *)®s, 0) < 0) { | |
196 | + if(ptrace(PTRACE_GETREGS, tcp->pid, (char *)regs, 0) < 0) { | |
197 | perror("sigreturn: PTRACE_GETREGS "); | |
198 | return 0; | |
199 | } | |
200 | if(entering(tcp)) { | |
201 | tcp->u_arg[0] = 0; | |
202 | - i1 = regs.r_o1; | |
203 | + i1 = regs[REG_O6] + 24 * 4; | |
204 | if(umove(tcp, i1, &si) < 0) { | |
205 | perror("sigreturn: umove "); | |
206 | return 0; |