Add new header definitions from Linux 4.4 (plus older ptrace definitions).
[glibc.git] / sysdeps / unix / sysv / linux / aarch64 / sys / ptrace.h
blob506ecceee39d05412a4035c547d8a97600101ee4
1 /* `ptrace' debugger support interface. Linux version.
2 Copyright (C) 1996-2016 Free Software Foundation, Inc.
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
28 /* Type of the REQUEST argument to `ptrace.' */
29 enum __ptrace_request
31 /* Indicate that the process making this request should be traced.
32 All signals received by this process can be intercepted by its
33 parent, and its parent can use the other `ptrace' requests. */
34 PTRACE_TRACEME = 0,
35 #define PT_TRACE_ME PTRACE_TRACEME
37 /* Return the word in the process's text space at address ADDR. */
38 PTRACE_PEEKTEXT = 1,
39 #define PT_READ_I PTRACE_PEEKTEXT
41 /* Return the word in the process's data space at address ADDR. */
42 PTRACE_PEEKDATA = 2,
43 #define PT_READ_D PTRACE_PEEKDATA
45 /* Return the word in the process's user area at offset ADDR. */
46 PTRACE_PEEKUSER = 3,
47 #define PT_READ_U PTRACE_PEEKUSER
49 /* Write the word DATA into the process's text space at address ADDR. */
50 PTRACE_POKETEXT = 4,
51 #define PT_WRITE_I PTRACE_POKETEXT
53 /* Write the word DATA into the process's data space at address ADDR. */
54 PTRACE_POKEDATA = 5,
55 #define PT_WRITE_D PTRACE_POKEDATA
57 /* Write the word DATA into the process's user area at offset ADDR. */
58 PTRACE_POKEUSER = 6,
59 #define PT_WRITE_U PTRACE_POKEUSER
61 /* Continue the process. */
62 PTRACE_CONT = 7,
63 #define PT_CONTINUE PTRACE_CONT
65 /* Kill the process. */
66 PTRACE_KILL = 8,
67 #define PT_KILL PTRACE_KILL
69 /* Single step the process. */
70 PTRACE_SINGLESTEP = 9,
71 #define PT_STEP PTRACE_SINGLESTEP
73 /* Attach to a process that is already running. */
74 PTRACE_ATTACH = 16,
75 #define PT_ATTACH PTRACE_ATTACH
77 /* Detach from a process attached to with PTRACE_ATTACH. */
78 PTRACE_DETACH = 17,
79 #define PT_DETACH PTRACE_DETACH
81 PTRACE_GET_THREAD_AREA = 22,
83 /* Continue and stop at the next (return from) syscall. */
84 PTRACE_SYSCALL = 24,
85 #define PT_SYSCALL PTRACE_SYSCALL
87 /* Get all hardware breakpoint registers. */
88 PTRACE_GETHBPREGS = 29,
90 /* Set all hardware breakpoint registers. */
91 PTRACE_SETHBPREGS = 30,
93 /* Set ptrace filter options. */
94 PTRACE_SETOPTIONS = 0x4200,
95 #define PT_SETOPTIONS PTRACE_SETOPTIONS
97 /* Get last ptrace message. */
98 PTRACE_GETEVENTMSG = 0x4201,
99 #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
101 /* Get siginfo for process. */
102 PTRACE_GETSIGINFO = 0x4202,
103 #define PT_GETSIGINFO PTRACE_GETSIGINFO
105 /* Set new siginfo for process. */
106 PTRACE_SETSIGINFO = 0x4203,
107 #define PT_SETSIGINFO PTRACE_SETSIGINFO
109 /* Get register content. */
110 PTRACE_GETREGSET = 0x4204,
111 #define PTRACE_GETREGSET PTRACE_GETREGSET
113 /* Set register content. */
114 PTRACE_SETREGSET = 0x4205,
115 #define PTRACE_SETREGSET PTRACE_SETREGSET
117 /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
118 signal or group stop state. */
119 PTRACE_SEIZE = 0x4206,
120 #define PTRACE_SEIZE PTRACE_SEIZE
122 /* Trap seized trace. */
123 PTRACE_INTERRUPT = 0x4207,
124 #define PTRACE_INTERRUPT PTRACE_INTERRUPT
126 /* Wait for next group event. */
127 PTRACE_LISTEN = 0x4208,
128 #define PTRACE_LISTEN PTRACE_LISTEN
130 PTRACE_PEEKSIGINFO = 0x4209,
131 #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
133 PTRACE_GETSIGMASK = 0x420a,
134 #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
136 PTRACE_SETSIGMASK = 0x420b,
137 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
139 PTRACE_SECCOMP_GET_FILTER = 0x420c
140 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
144 /* Flag for PTRACE_LISTEN. */
145 enum __ptrace_flags
147 PTRACE_SEIZE_DEVEL = 0x80000000
150 /* Options set using PTRACE_SETOPTIONS. */
151 enum __ptrace_setoptions
153 PTRACE_O_TRACESYSGOOD = 0x00000001,
154 PTRACE_O_TRACEFORK = 0x00000002,
155 PTRACE_O_TRACEVFORK = 0x00000004,
156 PTRACE_O_TRACECLONE = 0x00000008,
157 PTRACE_O_TRACEEXEC = 0x00000010,
158 PTRACE_O_TRACEVFORKDONE = 0x00000020,
159 PTRACE_O_TRACEEXIT = 0x00000040,
160 PTRACE_O_TRACESECCOMP = 0x00000080,
161 PTRACE_O_EXITKILL = 0x00100000,
162 PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
163 PTRACE_O_MASK = 0x003000ff
166 /* Wait extended result codes for the above trace options. */
167 enum __ptrace_eventcodes
169 PTRACE_EVENT_FORK = 1,
170 PTRACE_EVENT_VFORK = 2,
171 PTRACE_EVENT_CLONE = 3,
172 PTRACE_EVENT_EXEC = 4,
173 PTRACE_EVENT_VFORK_DONE = 5,
174 PTRACE_EVENT_EXIT = 6,
175 PTRACE_EVENT_SECCOMP = 7
178 /* Arguments for PTRACE_PEEKSIGINFO. */
179 struct __ptrace_peeksiginfo_args
181 __uint64_t off; /* From which siginfo to start. */
182 __uint32_t flags; /* Flags for peeksiginfo. */
183 __int32_t nr; /* How many siginfos to take. */
186 enum __ptrace_peeksiginfo_flags
188 /* Read signals from a shared (process wide) queue. */
189 PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
192 /* Perform process tracing functions. REQUEST is one of the values
193 above, and determines the action to be taken.
194 For all requests except PTRACE_TRACEME, PID specifies the process to be
195 traced.
197 PID and the other arguments described above for the various requests should
198 appear (those that are used for the particular request) as:
199 pid_t PID, void *ADDR, int DATA, void *ADDR2
200 after REQUEST. */
201 extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
203 __END_DECLS
205 #endif /* _SYS_PTRACE_H */