Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / unix / sysv / linux / s390 / sys / ptrace.h
blobd86188e5f319c854bc3cea103909f210d202feaa
1 /* `ptrace' debugger support interface. Linux version.
2 Copyright (C) 2000-2014 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 #ifdef _LINUX_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_PEEKUSR
34 #undef PTRACE_POKETEXT
35 #undef PTRACE_POKEDATA
36 #undef PTRACE_POKEUSR
37 #undef PTRACE_CONT
38 #undef PTRACE_KILL
39 #undef PTRACE_SINGLESTEP
41 #undef PTRACE_ATTACH
42 #undef PTRACE_DETACH
44 #undef PTRACE_SYSCALL
45 #endif
46 /* Type of the REQUEST argument to `ptrace.' */
47 enum __ptrace_request
49 /* Indicate that the process making this request should be traced.
50 All signals received by this process can be intercepted by its
51 parent, and its parent can use the other `ptrace' requests. */
52 PTRACE_TRACEME = 0,
53 #define PT_TRACE_ME PTRACE_TRACEME
55 /* Return the word in the process's text space at address ADDR. */
56 PTRACE_PEEKTEXT = 1,
57 #define PT_READ_I PTRACE_PEEKTEXT
59 /* Return the word in the process's data space at address ADDR. */
60 PTRACE_PEEKDATA = 2,
61 #define PT_READ_D PTRACE_PEEKDATA
63 /* Return the word in the process's user area at offset ADDR. */
64 PTRACE_PEEKUSER = 3,
65 #define PT_READ_U PTRACE_PEEKUSER
67 /* Write the word DATA into the process's text space at address ADDR. */
68 PTRACE_POKETEXT = 4,
69 #define PT_WRITE_I PTRACE_POKETEXT
71 /* Write the word DATA into the process's data space at address ADDR. */
72 PTRACE_POKEDATA = 5,
73 #define PT_WRITE_D PTRACE_POKEDATA
75 /* Write the word DATA into the process's user area at offset ADDR. */
76 PTRACE_POKEUSER = 6,
77 #define PT_WRITE_U PTRACE_POKEUSER
79 /* Continue the process. */
80 PTRACE_CONT = 7,
81 #define PT_CONTINUE PTRACE_CONT
83 /* Kill the process. */
84 PTRACE_KILL = 8,
85 #define PT_KILL PTRACE_KILL
87 /* Single step the process.
88 This is not supported on all machines. */
89 PTRACE_SINGLESTEP = 9,
90 #define PT_STEP PTRACE_SINGLESTEP
92 /* Get all general purpose registers used by a processes.
93 This is not supported on all machines. */
94 PTRACE_GETREGS = 12,
95 #define PT_GETREGS PTRACE_GETREGS
97 /* Set all general purpose registers used by a processes.
98 This is not supported on all machines. */
99 PTRACE_SETREGS = 13,
100 #define PT_SETREGS PTRACE_SETREGS
102 /* Get all floating point registers used by a processes.
103 This is not supported on all machines. */
104 PTRACE_GETFPREGS = 14,
105 #define PT_GETFPREGS PTRACE_GETFPREGS
107 /* Set all floating point registers used by a processes.
108 This is not supported on all machines. */
109 PTRACE_SETFPREGS = 15,
110 #define PT_SETFPREGS PTRACE_SETFPREGS
112 /* Attach to a process that is already running. */
113 PTRACE_ATTACH = 16,
114 #define PT_ATTACH PTRACE_ATTACH
116 /* Detach from a process attached to with PTRACE_ATTACH. */
117 PTRACE_DETACH = 17,
118 #define PT_DETACH PTRACE_DETACH
120 /* Continue and stop at the next (return from) syscall. */
121 PTRACE_SYSCALL = 24,
122 #define PT_SYSCALL PTRACE_SYSCALL
124 /* Set ptrace filter options. */
125 PTRACE_SETOPTIONS = 0x4200,
126 #define PT_SETOPTIONS PTRACE_SETOPTIONS
128 /* Get last ptrace message. */
129 PTRACE_GETEVENTMSG = 0x4201,
130 #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
132 /* Get siginfo for process. */
133 PTRACE_GETSIGINFO = 0x4202,
134 #define PT_GETSIGINFO PTRACE_GETSIGINFO
136 /* Set new siginfo for process. */
137 PTRACE_SETSIGINFO = 0x4203,
138 #define PT_SETSIGINFO PTRACE_SETSIGINFO
140 /* Get register content. */
141 PTRACE_GETREGSET = 0x4204,
142 #define PTRACE_GETREGSET PTRACE_GETREGSET
144 /* Set register content. */
145 PTRACE_SETREGSET = 0x4205,
146 #define PTRACE_SETREGSET PTRACE_SETREGSET
148 /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
149 signal or group stop state. */
150 PTRACE_SEIZE = 0x4206,
151 #define PTRACE_SEIZE PTRACE_SEIZE
153 /* Trap seized tracee. */
154 PTRACE_INTERRUPT = 0x4207,
155 #define PTRACE_INTERRUPT PTRACE_INTERRUPT
157 /* Wait for next group event. */
158 PTRACE_LISTEN = 0x4208,
159 #define PTRACE_LISTEN PTRACE_LISTEN
161 PTRACE_PEEKSIGINFO = 0x4209
162 #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
166 /* Flag for PTRACE_LISTEN. */
167 enum __ptrace_flags
169 PTRACE_SEIZE_DEVEL = 0x80000000
172 /* Options set using PTRACE_SETOPTIONS. */
173 enum __ptrace_setoptions
175 PTRACE_O_TRACESYSGOOD = 0x00000001,
176 PTRACE_O_TRACEFORK = 0x00000002,
177 PTRACE_O_TRACEVFORK = 0x00000004,
178 PTRACE_O_TRACECLONE = 0x00000008,
179 PTRACE_O_TRACEEXEC = 0x00000010,
180 PTRACE_O_TRACEVFORKDONE = 0x00000020,
181 PTRACE_O_TRACEEXIT = 0x00000040,
182 PTRACE_O_TRACESECCOMP = 0x00000080,
183 PTRACE_O_EXITKILL = 0x00100000,
184 PTRACE_O_MASK = 0x001000ff
187 /* Wait extended result codes for the above trace options. */
188 enum __ptrace_eventcodes
190 PTRACE_EVENT_FORK = 1,
191 PTRACE_EVENT_VFORK = 2,
192 PTRACE_EVENT_CLONE = 3,
193 PTRACE_EVENT_EXEC = 4,
194 PTRACE_EVENT_VFORK_DONE = 5,
195 PTRACE_EVENT_EXIT = 6,
196 PTRACE_EVENT_SECCOMP = 7
199 /* Arguments for PTRACE_PEEKSIGINFO. */
200 struct ptrace_peeksiginfo_args
202 __uint64_t off; /* From which siginfo to start. */
203 __uint32_t flags; /* Flags for peeksiginfo. */
204 __int32_t nr; /* How many siginfos to take. */
207 enum __ptrace_peeksiginfo_flags
209 /* Read signals from a shared (process wide) queue. */
210 PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
213 /* Perform process tracing functions. REQUEST is one of the values
214 above, and determines the action to be taken.
215 For all requests except PTRACE_TRACEME, PID specifies the process to be
216 traced.
218 PID and the other arguments described above for the various requests should
219 appear (those that are used for the particular request) as:
220 pid_t PID, void *ADDR, int DATA, void *ADDR2
221 after REQUEST. */
222 extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
224 __END_DECLS
226 #endif /* _SYS_PTRACE_H */