linux: move a shared part of sys/ptrace.h to bits/ptrace-shared.h
[glibc.git] / sysdeps / unix / sysv / linux / s390 / sys / ptrace.h
blob57c9793bc6039d1128b020288c8683179b7c488b
1 /* `ptrace' debugger support interface. Linux/S390 version.
2 Copyright (C) 2000-2017 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 <http://www.gnu.org/licenses/>. */
20 #ifndef _SYS_PTRACE_H
21 #define _SYS_PTRACE_H 1
23 #include <features.h>
24 #include <bits/types.h>
26 __BEGIN_DECLS
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
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
81 #endif
82 /* Type of the REQUEST argument to `ptrace.' */
83 enum __ptrace_request
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
91 /* Return the word in the process's text space at address ADDR. */
92 PTRACE_PEEKTEXT = 1,
93 #define PT_READ_I PTRACE_PEEKTEXT
95 /* Return the word in the process's data space at address ADDR. */
96 PTRACE_PEEKDATA = 2,
97 #define PT_READ_D PTRACE_PEEKDATA
99 /* Return the word in the process's user area at offset ADDR. */
100 PTRACE_PEEKUSER = 3,
101 #define PT_READ_U PTRACE_PEEKUSER
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
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
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
115 /* Continue the process. */
116 PTRACE_CONT = 7,
117 #define PT_CONTINUE PTRACE_CONT
119 /* Kill the process. */
120 PTRACE_KILL = 8,
121 #define PT_KILL PTRACE_KILL
123 /* Single step the process.
124 This is not supported on all machines. */
125 PTRACE_SINGLESTEP = 9,
126 #define PT_STEP PTRACE_SINGLESTEP
128 /* Execute process until next taken branch. */
129 PTRACE_SINGLEBLOCK = 12,
130 #define PT_STEPBLOCK PTRACE_SINGLEBLOCK
132 /* Attach to a process that is already running. */
133 PTRACE_ATTACH = 16,
134 #define PT_ATTACH PTRACE_ATTACH
136 /* Detach from a process attached to with PTRACE_ATTACH. */
137 PTRACE_DETACH = 17,
138 #define PT_DETACH PTRACE_DETACH
140 /* Continue and stop at the next (return from) syscall. */
141 PTRACE_SYSCALL = 24,
142 #define PT_SYSCALL PTRACE_SYSCALL
144 /* Set ptrace filter options. */
145 PTRACE_SETOPTIONS = 0x4200,
146 #define PT_SETOPTIONS PTRACE_SETOPTIONS
148 /* Get last ptrace message. */
149 PTRACE_GETEVENTMSG = 0x4201,
150 #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
152 /* Get siginfo for process. */
153 PTRACE_GETSIGINFO = 0x4202,
154 #define PT_GETSIGINFO PTRACE_GETSIGINFO
156 /* Set new siginfo for process. */
157 PTRACE_SETSIGINFO = 0x4203,
158 #define PT_SETSIGINFO PTRACE_SETSIGINFO
160 /* Get register content. */
161 PTRACE_GETREGSET = 0x4204,
162 #define PTRACE_GETREGSET PTRACE_GETREGSET
164 /* Set register content. */
165 PTRACE_SETREGSET = 0x4205,
166 #define PTRACE_SETREGSET PTRACE_SETREGSET
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
173 /* Trap seized tracee. */
174 PTRACE_INTERRUPT = 0x4207,
175 #define PTRACE_INTERRUPT PTRACE_INTERRUPT
177 /* Wait for next group event. */
178 PTRACE_LISTEN = 0x4208,
179 #define PTRACE_LISTEN PTRACE_LISTEN
181 PTRACE_PEEKSIGINFO = 0x4209,
182 #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
184 PTRACE_GETSIGMASK = 0x420a,
185 #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
187 PTRACE_SETSIGMASK = 0x420b,
188 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
190 PTRACE_SECCOMP_GET_FILTER = 0x420c,
191 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
193 PTRACE_PEEKUSR_AREA = 0x5000,
194 #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA
196 PTRACE_POKEUSR_AREA = 0x5001,
197 #define PTRACE_POKEUSR_AREA PTRACE_POKEUSR_AREA
199 PTRACE_GET_LAST_BREAK = 0x5006,
200 #define PTRACE_GET_LAST_BREAK PTRACE_GET_LAST_BREAK
202 PTRACE_ENABLE_TE = 0x5009,
203 #define PTRACE_ENABLE_TE PTRACE_ENABLE_TE
205 PTRACE_DISABLE_TE = 0x5010,
206 #define PTRACE_DISABLE_TE PTRACE_DISABLE_TE
208 PTRACE_TE_ABORT_RAND = 0x5011
209 #define PTRACE_TE_ABORT_RAND PTRACE_TE_ABORT_RAND
213 #include <bits/ptrace-shared.h>
215 __END_DECLS
217 #endif /* _SYS_PTRACE_H */