]>
Commit | Line | Data |
---|---|---|
7e21972b | 1 | /* `ptrace' debugger support interface. Linux/S390 version. |
2b778ceb | 2 | Copyright (C) 2000-2021 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 | 17 | License along with the GNU C Library; if not, see |
5a82c748 | 18 | <https://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 | |
d1e411e5 JM |
82 | # undef PTRACE_GET_SYSCALL_INFO |
83 | # undef PTRACE_SYSCALL_INFO_NONE | |
84 | # undef PTRACE_SYSCALL_INFO_ENTRY | |
85 | # undef PTRACE_SYSCALL_INFO_EXIT | |
86 | # undef PTRACE_SYSCALL_INFO_SECCOMP | |
847b055c AJ |
87 | #endif |
88 | /* Type of the REQUEST argument to `ptrace.' */ | |
89 | enum __ptrace_request | |
90 | { | |
91 | /* Indicate that the process making this request should be traced. | |
92 | All signals received by this process can be intercepted by its | |
93 | parent, and its parent can use the other `ptrace' requests. */ | |
94 | PTRACE_TRACEME = 0, | |
95 | #define PT_TRACE_ME PTRACE_TRACEME | |
96 | ||
97 | /* Return the word in the process's text space at address ADDR. */ | |
98 | PTRACE_PEEKTEXT = 1, | |
99 | #define PT_READ_I PTRACE_PEEKTEXT | |
100 | ||
101 | /* Return the word in the process's data space at address ADDR. */ | |
102 | PTRACE_PEEKDATA = 2, | |
103 | #define PT_READ_D PTRACE_PEEKDATA | |
104 | ||
105 | /* Return the word in the process's user area at offset ADDR. */ | |
106 | PTRACE_PEEKUSER = 3, | |
107 | #define PT_READ_U PTRACE_PEEKUSER | |
108 | ||
109 | /* Write the word DATA into the process's text space at address ADDR. */ | |
110 | PTRACE_POKETEXT = 4, | |
111 | #define PT_WRITE_I PTRACE_POKETEXT | |
112 | ||
113 | /* Write the word DATA into the process's data space at address ADDR. */ | |
114 | PTRACE_POKEDATA = 5, | |
115 | #define PT_WRITE_D PTRACE_POKEDATA | |
116 | ||
117 | /* Write the word DATA into the process's user area at offset ADDR. */ | |
118 | PTRACE_POKEUSER = 6, | |
119 | #define PT_WRITE_U PTRACE_POKEUSER | |
120 | ||
121 | /* Continue the process. */ | |
122 | PTRACE_CONT = 7, | |
123 | #define PT_CONTINUE PTRACE_CONT | |
124 | ||
125 | /* Kill the process. */ | |
126 | PTRACE_KILL = 8, | |
127 | #define PT_KILL PTRACE_KILL | |
128 | ||
ac583f50 | 129 | /* Single step the process. */ |
847b055c AJ |
130 | PTRACE_SINGLESTEP = 9, |
131 | #define PT_STEP PTRACE_SINGLESTEP | |
132 | ||
b08a6a0d SL |
133 | /* Execute process until next taken branch. */ |
134 | PTRACE_SINGLEBLOCK = 12, | |
135 | #define PT_STEPBLOCK PTRACE_SINGLEBLOCK | |
847b055c AJ |
136 | |
137 | /* Attach to a process that is already running. */ | |
138 | PTRACE_ATTACH = 16, | |
139 | #define PT_ATTACH PTRACE_ATTACH | |
140 | ||
141 | /* Detach from a process attached to with PTRACE_ATTACH. */ | |
142 | PTRACE_DETACH = 17, | |
143 | #define PT_DETACH PTRACE_DETACH | |
144 | ||
ac583f50 | 145 | /* Continue and stop at the next entry to or return from syscall. */ |
0466106e | 146 | PTRACE_SYSCALL = 24, |
847b055c | 147 | #define PT_SYSCALL PTRACE_SYSCALL |
0466106e UD |
148 | |
149 | /* Set ptrace filter options. */ | |
150 | PTRACE_SETOPTIONS = 0x4200, | |
151 | #define PT_SETOPTIONS PTRACE_SETOPTIONS | |
152 | ||
153 | /* Get last ptrace message. */ | |
154 | PTRACE_GETEVENTMSG = 0x4201, | |
155 | #define PT_GETEVENTMSG PTRACE_GETEVENTMSG | |
156 | ||
157 | /* Get siginfo for process. */ | |
158 | PTRACE_GETSIGINFO = 0x4202, | |
159 | #define PT_GETSIGINFO PTRACE_GETSIGINFO | |
160 | ||
161 | /* Set new siginfo for process. */ | |
6761ac04 | 162 | PTRACE_SETSIGINFO = 0x4203, |
0466106e | 163 | #define PT_SETSIGINFO PTRACE_SETSIGINFO |
cbff0d96 UD |
164 | |
165 | /* Get register content. */ | |
166 | PTRACE_GETREGSET = 0x4204, | |
167 | #define PTRACE_GETREGSET PTRACE_GETREGSET | |
168 | ||
169 | /* Set register content. */ | |
170 | PTRACE_SETREGSET = 0x4205, | |
171 | #define PTRACE_SETREGSET PTRACE_SETREGSET | |
172 | ||
173 | /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect | |
174 | signal or group stop state. */ | |
175 | PTRACE_SEIZE = 0x4206, | |
176 | #define PTRACE_SEIZE PTRACE_SEIZE | |
177 | ||
178 | /* Trap seized tracee. */ | |
179 | PTRACE_INTERRUPT = 0x4207, | |
180 | #define PTRACE_INTERRUPT PTRACE_INTERRUPT | |
181 | ||
182 | /* Wait for next group event. */ | |
521c6785 AJ |
183 | PTRACE_LISTEN = 0x4208, |
184 | #define PTRACE_LISTEN PTRACE_LISTEN | |
185 | ||
ac583f50 | 186 | /* Retrieve siginfo_t structures without removing signals from a queue. */ |
fb53a27c | 187 | PTRACE_PEEKSIGINFO = 0x4209, |
521c6785 | 188 | #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO |
fb53a27c | 189 | |
ac583f50 | 190 | /* Get the mask of blocked signals. */ |
fb53a27c JM |
191 | PTRACE_GETSIGMASK = 0x420a, |
192 | #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK | |
193 | ||
ac583f50 | 194 | /* Change the mask of blocked signals. */ |
fb53a27c JM |
195 | PTRACE_SETSIGMASK = 0x420b, |
196 | #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK | |
197 | ||
ac583f50 | 198 | /* Get seccomp BPF filters. */ |
b08a6a0d | 199 | PTRACE_SECCOMP_GET_FILTER = 0x420c, |
fb53a27c | 200 | #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER |
b08a6a0d | 201 | |
9320ca88 JM |
202 | /* Get seccomp BPF filter metadata. */ |
203 | PTRACE_SECCOMP_GET_METADATA = 0x420d, | |
204 | #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA | |
205 | ||
d1e411e5 JM |
206 | /* Get information about system call. */ |
207 | PTRACE_GET_SYSCALL_INFO = 0x420e, | |
208 | #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO | |
209 | ||
b08a6a0d SL |
210 | PTRACE_PEEKUSR_AREA = 0x5000, |
211 | #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA | |
212 | ||
213 | PTRACE_POKEUSR_AREA = 0x5001, | |
214 | #define PTRACE_POKEUSR_AREA PTRACE_POKEUSR_AREA | |
215 | ||
216 | PTRACE_GET_LAST_BREAK = 0x5006, | |
217 | #define PTRACE_GET_LAST_BREAK PTRACE_GET_LAST_BREAK | |
218 | ||
219 | PTRACE_ENABLE_TE = 0x5009, | |
220 | #define PTRACE_ENABLE_TE PTRACE_ENABLE_TE | |
221 | ||
222 | PTRACE_DISABLE_TE = 0x5010, | |
223 | #define PTRACE_DISABLE_TE PTRACE_DISABLE_TE | |
224 | ||
225 | PTRACE_TE_ABORT_RAND = 0x5011 | |
226 | #define PTRACE_TE_ABORT_RAND PTRACE_TE_ABORT_RAND | |
cbff0d96 UD |
227 | }; |
228 | ||
229 | ||
7e21972b | 230 | #include <bits/ptrace-shared.h> |
847b055c AJ |
231 | |
232 | __END_DECLS | |
233 | ||
234 | #endif /* _SYS_PTRACE_H */ |