1 /* `ptrace' debugger support interface. Linux/PowerPC version.
2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
20 #define _SYS_PTRACE_H 1
23 #include <bits/types.h>
27 #if defined _LINUX_PTRACE_H || defined _ASM_POWERPC_PTRACE_H
28 /* Do not let Linux headers macros interfere with enum __ptrace_request. */
32 # undef PTRACE_GET_DEBUGREG
33 # undef PTRACE_GETEVENTMSG
34 # undef PTRACE_GETEVRREGS
35 # undef PTRACE_GETFPREGS
36 # undef PTRACE_GETREGS
37 # undef PTRACE_GETREGS64
38 # undef PTRACE_GETREGSET
39 # undef PTRACE_GETSIGINFO
40 # undef PTRACE_GETSIGMASK
41 # undef PTRACE_GETVRREGS
42 # undef PTRACE_GETVSRREGS
43 # undef PTRACE_INTERRUPT
46 # undef PTRACE_PEEKDATA
47 # undef PTRACE_PEEKSIGINFO
48 # undef PTRACE_PEEKTEXT
49 # undef PTRACE_POKEDATA
50 # undef PTRACE_POKETEXT
51 # undef PTRACE_SECCOMP_GET_FILTER
53 # undef PTRACE_SET_DEBUGREG
54 # undef PTRACE_SETEVRREGS
55 # undef PTRACE_SETFPREGS
56 # undef PTRACE_SETOPTIONS
57 # undef PTRACE_SETREGS
58 # undef PTRACE_SETREGS64
59 # undef PTRACE_SETREGSET
60 # undef PTRACE_SETSIGINFO
61 # undef PTRACE_SETSIGMASK
62 # undef PTRACE_SETVRREGS
63 # undef PTRACE_SETVSRREGS
64 # undef PTRACE_SINGLEBLOCK
65 # undef PTRACE_SINGLESTEP
66 # undef PTRACE_SYSCALL
67 # undef PTRACE_TRACEME
70 /* Type of the REQUEST argument to `ptrace.' */
73 /* Indicate that the process making this request should be traced.
74 All signals received by this process can be intercepted by its
75 parent, and its parent can use the other `ptrace' requests. */
77 #define PT_TRACE_ME PTRACE_TRACEME
79 /* Return the word in the process's text space at address ADDR. */
81 #define PT_READ_I PTRACE_PEEKTEXT
83 /* Return the word in the process's data space at address ADDR. */
85 #define PT_READ_D PTRACE_PEEKDATA
87 /* Return the word in the process's user area at offset ADDR. */
89 #define PT_READ_U PTRACE_PEEKUSER
91 /* Write the word DATA into the process's text space at address ADDR. */
93 #define PT_WRITE_I PTRACE_POKETEXT
95 /* Write the word DATA into the process's data space at address ADDR. */
97 #define PT_WRITE_D PTRACE_POKEDATA
99 /* Write the word DATA into the process's user area at offset ADDR. */
101 #define PT_WRITE_U PTRACE_POKEUSER
103 /* Continue the process. */
105 #define PT_CONTINUE PTRACE_CONT
107 /* Kill the process. */
109 #define PT_KILL PTRACE_KILL
111 /* Single step the process. */
112 PTRACE_SINGLESTEP
= 9,
113 #define PT_STEP PTRACE_SINGLESTEP
115 /* Get all general purpose registers used by a process. */
117 #define PT_GETREGS PTRACE_GETREGS
119 /* Set all general purpose registers used by a process. */
121 #define PT_SETREGS PTRACE_SETREGS
123 /* Get all floating point registers used by a process. */
124 PTRACE_GETFPREGS
= 14,
125 #define PT_GETFPREGS PTRACE_GETFPREGS
127 /* Set all floating point registers used by a process. */
128 PTRACE_SETFPREGS
= 15,
129 #define PT_SETFPREGS PTRACE_SETFPREGS
131 /* Attach to a process that is already running. */
133 #define PT_ATTACH PTRACE_ATTACH
135 /* Detach from a process attached to with PTRACE_ATTACH. */
137 #define PT_DETACH PTRACE_DETACH
139 /* Get all altivec registers used by a process. */
140 PTRACE_GETVRREGS
= 18,
141 #define PT_GETVRREGS PTRACE_GETVRREGS
143 /* Set all altivec registers used by a process. */
144 PTRACE_SETVRREGS
= 19,
145 #define PT_SETVRREGS PTRACE_SETVRREGS
147 /* Get all SPE registers used by a process. */
148 PTRACE_GETEVRREGS
= 20,
149 #define PT_GETEVRREGS PTRACE_GETEVRREGS
151 /* Set all SPE registers used by a process. */
152 PTRACE_SETEVRREGS
= 21,
153 #define PT_SETEVRREGS PTRACE_SETEVRREGS
155 /* Same as PTRACE_GETREGS except a 32-bit process will obtain
156 the full 64-bit registers. Implemented by 64-bit kernels only. */
157 PTRACE_GETREGS64
= 22,
158 #define PT_GETREGS64 PTRACE_GETREGS64
160 /* Same as PTRACE_SETREGS except a 32-bit process will set
161 the full 64-bit registers. Implemented by 64-bit kernels only. */
162 PTRACE_SETREGS64
= 23,
163 #define PT_SETREGS64 PTRACE_SETREGS64
165 /* Continue and stop at the next entry to or return from syscall. */
167 #define PT_SYSCALL PTRACE_SYSCALL
169 /* Get a debug register of a process. */
170 PTRACE_GET_DEBUGREG
= 25,
171 #define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
173 /* Set a debug register of a process. */
174 PTRACE_SET_DEBUGREG
= 26,
175 #define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
177 /* Get the first 32 VSX registers of a process. */
178 PTRACE_GETVSRREGS
= 27,
179 #define PT_GETVSRREGS PTRACE_GETVSRREGS
181 /* Set the first 32 VSX registers of a process. */
182 PTRACE_SETVSRREGS
= 28,
183 #define PT_SETVSRREGS PTRACE_SETVSRREGS
185 /* Execute process until next taken branch. */
186 PTRACE_SINGLEBLOCK
= 256,
187 #define PT_STEPBLOCK PTRACE_SINGLEBLOCK
189 /* Set ptrace filter options. */
190 PTRACE_SETOPTIONS
= 0x4200,
191 #define PT_SETOPTIONS PTRACE_SETOPTIONS
193 /* Get last ptrace message. */
194 PTRACE_GETEVENTMSG
= 0x4201,
195 #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
197 /* Get siginfo for process. */
198 PTRACE_GETSIGINFO
= 0x4202,
199 #define PT_GETSIGINFO PTRACE_GETSIGINFO
201 /* Set new siginfo for process. */
202 PTRACE_SETSIGINFO
= 0x4203,
203 #define PT_SETSIGINFO PTRACE_SETSIGINFO
205 /* Get register content. */
206 PTRACE_GETREGSET
= 0x4204,
207 #define PTRACE_GETREGSET PTRACE_GETREGSET
209 /* Set register content. */
210 PTRACE_SETREGSET
= 0x4205,
211 #define PTRACE_SETREGSET PTRACE_SETREGSET
213 /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
214 signal or group stop state. */
215 PTRACE_SEIZE
= 0x4206,
216 #define PTRACE_SEIZE PTRACE_SEIZE
218 /* Trap seized tracee. */
219 PTRACE_INTERRUPT
= 0x4207,
220 #define PTRACE_INTERRUPT PTRACE_INTERRUPT
222 /* Wait for next group event. */
223 PTRACE_LISTEN
= 0x4208,
224 #define PTRACE_LISTEN PTRACE_LISTEN
226 /* Retrieve siginfo_t structures without removing signals from a queue. */
227 PTRACE_PEEKSIGINFO
= 0x4209,
228 #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
230 /* Get the mask of blocked signals. */
231 PTRACE_GETSIGMASK
= 0x420a,
232 #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
234 /* Change the mask of blocked signals. */
235 PTRACE_SETSIGMASK
= 0x420b,
236 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
238 /* Get seccomp BPF filters. */
239 PTRACE_SECCOMP_GET_FILTER
= 0x420c
240 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
244 #include <bits/ptrace-shared.h>
248 #endif /* _SYS_PTRACE_H */