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