1 /* `ptrace' debugger support interface. Linux/S390 version.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
3 Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
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.
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
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */
21 #define _SYS_PTRACE_H 1
24 #include <bits/types.h>
27 #if defined _LINUX_PTRACE_H || defined _S390_PTRACE_H
28 /* Kludge to stop stuff gdb & strace compiles from getting upset
30 # undef PTRACE_TRACEME
31 # undef PTRACE_PEEKTEXT
32 # undef PTRACE_PEEKDATA
33 # undef PTRACE_POKETEXT
34 # undef PTRACE_POKEDATA
37 # undef PTRACE_SINGLESTEP
38 # undef PTRACE_SINGLEBLOCK
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
49 # undef PTRACE_INTERRUPT
51 # undef PTRACE_PEEKSIGINFO
52 # undef PTRACE_GETSIGMASK
53 # undef PTRACE_SETSIGMASK
54 # undef PTRACE_SECCOMP_GET_FILTER
55 # undef PTRACE_SECCOMP_GET_METADATA
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
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
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
88 /* Type of the REQUEST argument to `ptrace.' */
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. */
95 #define PT_TRACE_ME PTRACE_TRACEME
97 /* Return the word in the process's text space at address ADDR. */
99 #define PT_READ_I PTRACE_PEEKTEXT
101 /* Return the word in the process's data space at address ADDR. */
103 #define PT_READ_D PTRACE_PEEKDATA
105 /* Return the word in the process's user area at offset ADDR. */
107 #define PT_READ_U PTRACE_PEEKUSER
109 /* Write the word DATA into the process's text space at address ADDR. */
111 #define PT_WRITE_I PTRACE_POKETEXT
113 /* Write the word DATA into the process's data space at address ADDR. */
115 #define PT_WRITE_D PTRACE_POKEDATA
117 /* Write the word DATA into the process's user area at offset ADDR. */
119 #define PT_WRITE_U PTRACE_POKEUSER
121 /* Continue the process. */
123 #define PT_CONTINUE PTRACE_CONT
125 /* Kill the process. */
127 #define PT_KILL PTRACE_KILL
129 /* Single step the process. */
130 PTRACE_SINGLESTEP
= 9,
131 #define PT_STEP PTRACE_SINGLESTEP
133 /* Execute process until next taken branch. */
134 PTRACE_SINGLEBLOCK
= 12,
135 #define PT_STEPBLOCK PTRACE_SINGLEBLOCK
137 /* Attach to a process that is already running. */
139 #define PT_ATTACH PTRACE_ATTACH
141 /* Detach from a process attached to with PTRACE_ATTACH. */
143 #define PT_DETACH PTRACE_DETACH
145 /* Continue and stop at the next entry to or return from syscall. */
147 #define PT_SYSCALL PTRACE_SYSCALL
149 /* Set ptrace filter options. */
150 PTRACE_SETOPTIONS
= 0x4200,
151 #define PT_SETOPTIONS PTRACE_SETOPTIONS
153 /* Get last ptrace message. */
154 PTRACE_GETEVENTMSG
= 0x4201,
155 #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
157 /* Get siginfo for process. */
158 PTRACE_GETSIGINFO
= 0x4202,
159 #define PT_GETSIGINFO PTRACE_GETSIGINFO
161 /* Set new siginfo for process. */
162 PTRACE_SETSIGINFO
= 0x4203,
163 #define PT_SETSIGINFO PTRACE_SETSIGINFO
165 /* Get register content. */
166 PTRACE_GETREGSET
= 0x4204,
167 #define PTRACE_GETREGSET PTRACE_GETREGSET
169 /* Set register content. */
170 PTRACE_SETREGSET
= 0x4205,
171 #define PTRACE_SETREGSET PTRACE_SETREGSET
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
178 /* Trap seized tracee. */
179 PTRACE_INTERRUPT
= 0x4207,
180 #define PTRACE_INTERRUPT PTRACE_INTERRUPT
182 /* Wait for next group event. */
183 PTRACE_LISTEN
= 0x4208,
184 #define PTRACE_LISTEN PTRACE_LISTEN
186 /* Retrieve siginfo_t structures without removing signals from a queue. */
187 PTRACE_PEEKSIGINFO
= 0x4209,
188 #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
190 /* Get the mask of blocked signals. */
191 PTRACE_GETSIGMASK
= 0x420a,
192 #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
194 /* Change the mask of blocked signals. */
195 PTRACE_SETSIGMASK
= 0x420b,
196 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
198 /* Get seccomp BPF filters. */
199 PTRACE_SECCOMP_GET_FILTER
= 0x420c,
200 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
202 /* Get seccomp BPF filter metadata. */
203 PTRACE_SECCOMP_GET_METADATA
= 0x420d,
204 #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
206 /* Get information about system call. */
207 PTRACE_GET_SYSCALL_INFO
= 0x420e,
208 #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
210 PTRACE_PEEKUSR_AREA
= 0x5000,
211 #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA
213 PTRACE_POKEUSR_AREA
= 0x5001,
214 #define PTRACE_POKEUSR_AREA PTRACE_POKEUSR_AREA
216 PTRACE_GET_LAST_BREAK
= 0x5006,
217 #define PTRACE_GET_LAST_BREAK PTRACE_GET_LAST_BREAK
219 PTRACE_ENABLE_TE
= 0x5009,
220 #define PTRACE_ENABLE_TE PTRACE_ENABLE_TE
222 PTRACE_DISABLE_TE
= 0x5010,
223 #define PTRACE_DISABLE_TE PTRACE_DISABLE_TE
225 PTRACE_TE_ABORT_RAND
= 0x5011
226 #define PTRACE_TE_ABORT_RAND PTRACE_TE_ABORT_RAND
230 #include <bits/ptrace-shared.h>
234 #endif /* _SYS_PTRACE_H */