summaryrefslogtreecommitdiff
path: root/sysutils/strace/patches/patch-ao
blob: c23bcafb38943c54e6373b5efed374ededa6254b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
$NetBSD: patch-ao,v 1.2 2007/04/27 19:45:02 christos Exp $

--- process.c.orig	2005-08-03 07:23:43.000000000 -0400
+++ process.c	2007-04-27 14:39:18.000000000 -0400
@@ -40,6 +40,7 @@
 #include "defs.h"
 
 #include <fcntl.h>
+#include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/wait.h>
@@ -52,7 +53,7 @@
 #include <machine/reg.h>
 #endif /* SUNOS4 */
 
-#ifdef FREEBSD
+#ifdef ALLBSD
 #include <sys/ptrace.h>
 #endif
 
@@ -1042,7 +1043,7 @@
 
 #endif /* !USE_PROCFS */
 
-#if defined(SUNOS4) || defined(LINUX) || defined(FREEBSD)
+#if defined(SUNOS4) || defined(LINUX) || defined(ALLBSD)
 
 int
 sys_vfork(tcp)
@@ -1053,7 +1054,7 @@
 	return 0;
 }
 
-#endif /* SUNOS4 || LINUX || FREEBSD */
+#endif /* SUNOS4 || LINUX || ALLBSD */
 
 #ifndef LINUX
 
@@ -2035,7 +2036,7 @@
 
 #endif /* SVR4 */
 
-#ifdef FREEBSD
+#ifdef ALLBSD
 int
 sys_wait(tcp)
 struct tcb *tcp;
@@ -2189,7 +2190,7 @@
 #ifndef SVR4
 
 static const struct xlat ptrace_cmds[] = {
-#ifndef FREEBSD
+#ifndef ALLBSD
 	{ PTRACE_TRACEME,	"PTRACE_TRACEME"	},
 	{ PTRACE_PEEKTEXT,	"PTRACE_PEEKTEXT",	},
 	{ PTRACE_PEEKDATA,	"PTRACE_PEEKDATA",	},
@@ -2255,7 +2256,7 @@
 #endif /* !I386 */
 	{ PTRACE_GETUCODE,	"PTRACE_GETUCODE"	},
 #endif /* SUNOS4 */
-#else /* FREEBSD */
+#else /* ALLBSD */
 	{ PT_TRACE_ME,		"PT_TRACE_ME"		},
 	{ PT_READ_I,		"PT_READ_I"		},
 	{ PT_READ_D,		"PT_READ_D"		},
@@ -2273,13 +2274,17 @@
 	{ PT_SETREGS,		"PT_SETREGS"		},
 	{ PT_GETFPREGS,		"PT_GETFPREGS"		},
 	{ PT_SETFPREGS,		"PT_SETFPREGS"		},
+#ifdef PT_GETDBREGS
 	{ PT_GETDBREGS,		"PT_GETDBREGS"		},
+#endif
+#ifdef PT_SETDBREGS
 	{ PT_SETDBREGS,		"PT_SETDBREGS"		},
-#endif /* FREEBSD */
+#endif
+#endif /* ALLBSD */
 	{ 0,			NULL			},
 };
 
-#ifndef FREEBSD
+#ifndef ALLBSD
 #ifndef SUNOS4_KERNEL_ARCH_KLUDGE
 static
 #endif /* !SUNOS4_KERNEL_ARCH_KLUDGE */
@@ -2966,12 +2971,14 @@
 sys_ptrace(tcp)
 struct tcb *tcp;
 {
+#ifndef NETBSD
 	const struct xlat *x;
+#endif
 	long addr;
 
 	if (entering(tcp)) {
 		printxval(ptrace_cmds, tcp->u_arg[0],
-#ifndef FREEBSD
+#ifndef ALLBSD
 			  "PTRACE_???"
 #else
 			  "PT_???"
@@ -2979,7 +2986,7 @@
 			);
 		tprintf(", %lu, ", tcp->u_arg[1]);
 		addr = tcp->u_arg[2];
-#ifndef FREEBSD
+#ifndef ALLBSD
 		if (tcp->u_arg[0] == PTRACE_PEEKUSER
 			|| tcp->u_arg[0] == PTRACE_POKEUSER) {
 			for (x = struct_user_offsets; x->str; x++) {
@@ -3041,10 +3048,10 @@
 		}
 	}
 #endif /* SUNOS4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
 		tprintf("%lu", tcp->u_arg[3]);
 	}
-#endif /* FREEBSD */
+#endif /* ALLBSD */
 	return 0;
 }