]>
Commit | Line | Data |
---|---|---|
7e21972b | 1 | /* `ptrace' debugger support interface. Linux/S390 version. |
04277e02 | 2 | Copyright (C) 2000-2019 Free Software Foundation, Inc. |
847b055c AJ |
3 | Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com). |
4 | This file is part of the GNU C Library. | |
5 | ||
6 | The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
7 | modify it under the terms of the GNU Lesser General Public |
8 | License as published by the Free Software Foundation; either | |
9 | version 2.1 of the License, or (at your option) any later version. | |
847b055c AJ |
10 | |
11 | The GNU C Library is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 14 | Lesser General Public License for more details. |
847b055c | 15 | |
41bdb6e2 | 16 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
17 | License along with the GNU C Library; if not, see |
18 | <http://www.gnu.org/licenses/>. */ | |
847b055c AJ |
19 | |
20 | #ifndef _SYS_PTRACE_H | |
21 | #define _SYS_PTRACE_H 1 | |
22 | ||
23 | #include <features.h> | |
521c6785 | 24 | #include <bits/types.h> |
847b055c AJ |
25 | |
26 | __BEGIN_DECLS | |
cab91f94 | 27 | #if defined _LINUX_PTRACE_H || defined _S390_PTRACE_H |
847b055c AJ |
28 | /* Kludge to stop stuff gdb & strace compiles from getting upset |
29 | */ | |
cab91f94 DL |
30 | # undef PTRACE_TRACEME |
31 | # undef PTRACE_PEEKTEXT | |
32 | # undef PTRACE_PEEKDATA | |
33 | # undef PTRACE_POKETEXT | |
34 | # undef PTRACE_POKEDATA | |
35 | # undef PTRACE_CONT | |
36 | # undef PTRACE_KILL | |
37 | # undef PTRACE_SINGLESTEP | |
38 | # undef PTRACE_SINGLEBLOCK | |
39 | # undef PTRACE_ATTACH | |
40 | # undef PTRACE_DETACH | |
41 | # undef PTRACE_SYSCALL | |
42 | # undef PTRACE_SETOPTIONS | |
43 | # undef PTRACE_GETEVENTMSG | |
44 | # undef PTRACE_GETSIGINFO | |
45 | # undef PTRACE_SETSIGINFO | |
46 | # undef PTRACE_GETREGSET | |
47 | # undef PTRACE_SETREGSET | |
48 | # undef PTRACE_SEIZE | |
49 | # undef PTRACE_INTERRUPT | |
50 | # undef PTRACE_LISTEN | |
51 | # undef PTRACE_PEEKSIGINFO | |
52 | # undef PTRACE_GETSIGMASK | |
53 | # undef PTRACE_SETSIGMASK | |
54 | # undef PTRACE_SECCOMP_GET_FILTER | |
9320ca88 | 55 | # undef PTRACE_SECCOMP_GET_METADATA |
cab91f94 DL |
56 | # undef PTRACE_PEEKUSR_AREA |
57 | # undef PTRACE_POKEUSR_AREA | |
58 | # undef PTRACE_GET_LAST_BREAK | |
59 | # undef PTRACE_ENABLE_TE | |
60 | # undef PTRACE_DISABLE_TE | |
61 | # undef PTRACE_TE_ABORT_RAND | |
62 | # undef PTRACE_O_TRACESYSGOOD | |
63 | # undef PTRACE_O_TRACEFORK | |
64 | # undef PTRACE_O_TRACEVFORK | |
65 | # undef PTRACE_O_TRACECLONE | |
66 | # undef PTRACE_O_TRACEEXEC | |
67 | # undef PTRACE_O_TRACEVFORKDONE | |
68 | # undef PTRACE_O_TRACEEXIT | |
69 | # undef PTRACE_O_TRACESECCOMP | |
70 | # undef PTRACE_O_EXITKILL | |
71 | # undef PTRACE_O_SUSPEND_SECCOMP | |
72 | # undef PTRACE_O_MASK | |
73 | # undef PTRACE_EVENT_FORK | |
74 | # undef PTRACE_EVENT_VFORK | |
75 | # undef PTRACE_EVENT_CLONE | |
76 | # undef PTRACE_EVENT_EXEC | |
77 | # undef PTRACE_EVENT_VFORK_DONE | |
78 | # undef PTRACE_EVENT_EXIT | |
79 | # undef PTRACE_EVENT_SECCOMP | |
80 | # undef PTRACE_EVENT_STOP | |
81 | # undef PTRACE_PEEKSIGINFO_SHARED | |
847b055c AJ |
82 | #endif |
83 | /* Type of the REQUEST argument to `ptrace.' */ | |
84 | enum __ptrace_request | |
85 | { | |
86 | /* Indicate that the process making this request should be traced. | |
87 | All signals received by this process can be intercepted by its | |
88 | parent, and its parent can use the other `ptrace' requests. */ | |
89 | PTRACE_TRACEME = 0, | |
90 | #define PT_TRACE_ME PTRACE_TRACEME | |
91 | ||
92 | /* Return the word in the process's text space at address ADDR. */ | |
93 | PTRACE_PEEKTEXT = 1, | |
94 | #define PT_READ_I PTRACE_PEEKTEXT | |
95 | ||
96 | /* Return the word in the process's data space at address ADDR. */ | |
97 | PTRACE_PEEKDATA = 2, | |
98 | #define PT_READ_D PTRACE_PEEKDATA | |
99 | ||
100 | /* Return the word in the process's user area at offset ADDR. */ | |
101 | PTRACE_PEEKUSER = 3, | |
102 | #define PT_READ_U PTRACE_PEEKUSER | |
103 | ||
104 | /* Write the word DATA into the process's text space at address ADDR. */ | |
105 | PTRACE_POKETEXT = 4, | |
106 | #define PT_WRITE_I PTRACE_POKETEXT | |
107 | ||
108 | /* Write the word DATA into the process's data space at address ADDR. */ | |
109 | PTRACE_POKEDATA = 5, | |
110 | #define PT_WRITE_D PTRACE_POKEDATA | |
111 | ||
112 | /* Write the word DATA into the process's user area at offset ADDR. */ | |
113 | PTRACE_POKEUSER = 6, | |
114 | #define PT_WRITE_U PTRACE_POKEUSER | |
115 | ||
116 | /* Continue the process. */ | |
117 | PTRACE_CONT = 7, | |
118 | #define PT_CONTINUE PTRACE_CONT | |
119 | ||
120 | /* Kill the process. */ | |
121 | PTRACE_KILL = 8, | |
122 | #define PT_KILL PTRACE_KILL | |
123 | ||
ac583f50 | 124 | /* Single step the process. */ |
847b055c AJ |
125 | PTRACE_SINGLESTEP = 9, |
126 | #define PT_STEP PTRACE_SINGLESTEP | |
127 | ||
b08a6a0d SL |
128 | /* Execute process until next taken branch. */ |
129 | PTRACE_SINGLEBLOCK = 12, | |
130 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK | |
847b055c AJ |
131 | |
132 | /* Attach to a process that is already running. */ | |
133 | PTRACE_ATTACH = 16, | |
134 | #define PT_ATTACH PTRACE_ATTACH | |
135 | ||
136 | /* Detach from a process attached to with PTRACE_ATTACH. */ | |
137 | PTRACE_DETACH = 17, | |
138 | #define PT_DETACH PTRACE_DETACH | |
139 | ||
ac583f50 | 140 | /* Continue and stop at the next entry to or return from syscall. */ |
0466106e | 141 | PTRACE_SYSCALL = 24, |
847b055c | 142 | #define PT_SYSCALL PTRACE_SYSCALL |
0466106e UD |
143 | |
144 | /* Set ptrace filter options. */ | |
145 | PTRACE_SETOPTIONS = 0x4200, | |
146 | #define PT_SETOPTIONS PTRACE_SETOPTIONS | |
147 | ||
148 | /* Get last ptrace message. */ | |
149 | PTRACE_GETEVENTMSG = 0x4201, | |
150 | #define PT_GETEVENTMSG PTRACE_GETEVENTMSG | |
151 | ||
152 | /* Get siginfo for process. */ | |
153 | PTRACE_GETSIGINFO = 0x4202, | |
154 | #define PT_GETSIGINFO PTRACE_GETSIGINFO | |
155 | ||
156 | /* Set new siginfo for process. */ | |
6761ac04 | 157 | PTRACE_SETSIGINFO = 0x4203, |
0466106e | 158 | #define PT_SETSIGINFO PTRACE_SETSIGINFO |
cbff0d96 UD |
159 | |
160 | /* Get register content. */ | |
161 | PTRACE_GETREGSET = 0x4204, | |
162 | #define PTRACE_GETREGSET PTRACE_GETREGSET | |
163 | ||
164 | /* Set register content. */ | |
165 | PTRACE_SETREGSET = 0x4205, | |
166 | #define PTRACE_SETREGSET PTRACE_SETREGSET | |
167 | ||
168 | /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect | |
169 | signal or group stop state. */ | |
170 | PTRACE_SEIZE = 0x4206, | |
171 | #define PTRACE_SEIZE PTRACE_SEIZE | |
172 | ||
173 | /* Trap seized tracee. */ | |
174 | PTRACE_INTERRUPT = 0x4207, | |
175 | #define PTRACE_INTERRUPT PTRACE_INTERRUPT | |
176 | ||
177 | /* Wait for next group event. */ | |
521c6785 AJ |
178 | PTRACE_LISTEN = 0x4208, |
179 | #define PTRACE_LISTEN PTRACE_LISTEN | |
180 | ||
ac583f50 | 181 | /* Retrieve siginfo_t structures without removing signals from a queue. */ |
fb53a27c | 182 | PTRACE_PEEKSIGINFO = 0x4209, |
521c6785 | 183 | #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO |
fb53a27c | 184 | |
ac583f50 | 185 | /* Get the mask of blocked signals. */ |
fb53a27c JM |
186 | PTRACE_GETSIGMASK = 0x420a, |
187 | #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK | |
188 | ||
ac583f50 | 189 | /* Change the mask of blocked signals. */ |
fb53a27c JM |
190 | PTRACE_SETSIGMASK = 0x420b, |
191 | #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK | |
192 | ||
ac583f50 | 193 | /* Get seccomp BPF filters. */ |
b08a6a0d | 194 | PTRACE_SECCOMP_GET_FILTER = 0x420c, |
fb53a27c | 195 | #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER |
b08a6a0d | 196 | |
9320ca88 JM |
197 | /* Get seccomp BPF filter metadata. */ |
198 | PTRACE_SECCOMP_GET_METADATA = 0x420d, | |
199 | #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA | |
200 | ||
b08a6a0d SL |
201 | PTRACE_PEEKUSR_AREA = 0x5000, |
202 | #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA | |
203 | ||
204 | PTRACE_POKEUSR_AREA = 0x5001, | |
205 | #define PTRACE_POKEUSR_AREA PTRACE_POKEUSR_AREA | |
206 | ||
207 | PTRACE_GET_LAST_BREAK = 0x5006, | |
208 | #define PTRACE_GET_LAST_BREAK PTRACE_GET_LAST_BREAK | |
209 | ||
210 | PTRACE_ENABLE_TE = 0x5009, | |
211 | #define PTRACE_ENABLE_TE PTRACE_ENABLE_TE | |
212 | ||
213 | PTRACE_DISABLE_TE = 0x5010, | |
214 | #define PTRACE_DISABLE_TE PTRACE_DISABLE_TE | |
215 | ||
216 | PTRACE_TE_ABORT_RAND = 0x5011 | |
217 | #define PTRACE_TE_ABORT_RAND PTRACE_TE_ABORT_RAND | |
cbff0d96 UD |
218 | }; |
219 | ||
220 | ||
7e21972b | 221 | #include <bits/ptrace-shared.h> |
847b055c AJ |
222 | |
223 | __END_DECLS | |
224 | ||
225 | #endif /* _SYS_PTRACE_H */ |