]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/sys/ptrace.h
Update copyright dates with scripts/update-copyrights
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / sys / ptrace.h
CommitLineData
bfc04a9f 1/* `ptrace' debugger support interface. Linux version.
2b778ceb 2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
ac583f50 3
54d79e99 4 This file is part of the GNU C Library.
28f540f4 5
54d79e99 6 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
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.
28f540f4 10
54d79e99
UD
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
41bdb6e2 14 Lesser General Public License for more details.
28f540f4 15
41bdb6e2 16 You should have received a copy of the GNU Lesser General Public
59ba27a6 17 License along with the GNU C Library; if not, see
5a82c748 18 <https://www.gnu.org/licenses/>. */
28f540f4 19
bfc04a9f 20#ifndef _SYS_PTRACE_H
8a4b65b4 21#define _SYS_PTRACE_H 1
8325d82c 22
28f540f4 23#include <features.h>
521c6785 24#include <bits/types.h>
28f540f4
RM
25
26__BEGIN_DECLS
27
28f540f4
RM
28/* Type of the REQUEST argument to `ptrace.' */
29enum __ptrace_request
30{
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
36
37 /* Return the word in the process's text space at address ADDR. */
4bbac92a 38 PTRACE_PEEKTEXT = 1,
28f540f4
RM
39#define PT_READ_I PTRACE_PEEKTEXT
40
41 /* Return the word in the process's data space at address ADDR. */
4bbac92a 42 PTRACE_PEEKDATA = 2,
28f540f4
RM
43#define PT_READ_D PTRACE_PEEKDATA
44
45 /* Return the word in the process's user area at offset ADDR. */
4bbac92a 46 PTRACE_PEEKUSER = 3,
28f540f4
RM
47#define PT_READ_U PTRACE_PEEKUSER
48
49 /* Write the word DATA into the process's text space at address ADDR. */
4bbac92a 50 PTRACE_POKETEXT = 4,
28f540f4
RM
51#define PT_WRITE_I PTRACE_POKETEXT
52
53 /* Write the word DATA into the process's data space at address ADDR. */
4bbac92a 54 PTRACE_POKEDATA = 5,
28f540f4
RM
55#define PT_WRITE_D PTRACE_POKEDATA
56
bfc04a9f 57 /* Write the word DATA into the process's user area at offset ADDR. */
4bbac92a 58 PTRACE_POKEUSER = 6,
28f540f4
RM
59#define PT_WRITE_U PTRACE_POKEUSER
60
61 /* Continue the process. */
4bbac92a 62 PTRACE_CONT = 7,
28f540f4
RM
63#define PT_CONTINUE PTRACE_CONT
64
65 /* Kill the process. */
4bbac92a 66 PTRACE_KILL = 8,
28f540f4
RM
67#define PT_KILL PTRACE_KILL
68
ac583f50 69 /* Single step the process. */
4bbac92a 70 PTRACE_SINGLESTEP = 9,
28f540f4
RM
71#define PT_STEP PTRACE_SINGLESTEP
72
4bbac92a
UD
73 /* Get all general purpose registers used by a processes.
74 This is not supported on all machines. */
ac583f50 75 PTRACE_GETREGS = 12,
4bbac92a
UD
76#define PT_GETREGS PTRACE_GETREGS
77
78 /* Set all general purpose registers used by a processes.
79 This is not supported on all machines. */
ac583f50 80 PTRACE_SETREGS = 13,
4bbac92a
UD
81#define PT_SETREGS PTRACE_SETREGS
82
83 /* Get all floating point registers used by a processes.
84 This is not supported on all machines. */
ac583f50 85 PTRACE_GETFPREGS = 14,
4bbac92a
UD
86#define PT_GETFPREGS PTRACE_GETFPREGS
87
88 /* Set all floating point registers used by a processes.
89 This is not supported on all machines. */
ac583f50 90 PTRACE_SETFPREGS = 15,
4bbac92a
UD
91#define PT_SETFPREGS PTRACE_SETFPREGS
92
28f540f4 93 /* Attach to a process that is already running. */
4bbac92a 94 PTRACE_ATTACH = 16,
28f540f4
RM
95#define PT_ATTACH PTRACE_ATTACH
96
97 /* Detach from a process attached to with PTRACE_ATTACH. */
4bbac92a 98 PTRACE_DETACH = 17,
28f540f4
RM
99#define PT_DETACH PTRACE_DETACH
100
64f022a4
UD
101 /* Get all extended floating point registers used by a processes.
102 This is not supported on all machines. */
ac583f50 103 PTRACE_GETFPXREGS = 18,
64f022a4
UD
104#define PT_GETFPXREGS PTRACE_GETFPXREGS
105
106 /* Set all extended floating point registers used by a processes.
107 This is not supported on all machines. */
ac583f50 108 PTRACE_SETFPXREGS = 19,
64f022a4
UD
109#define PT_SETFPXREGS PTRACE_SETFPXREGS
110
ac583f50 111 /* Continue and stop at the next entry to or return from syscall. */
9c316a45 112 PTRACE_SYSCALL = 24,
1055cf7c 113#define PT_SYSCALL PTRACE_SYSCALL
9c316a45
UD
114
115 /* Set ptrace filter options. */
116 PTRACE_SETOPTIONS = 0x4200,
117#define PT_SETOPTIONS PTRACE_SETOPTIONS
118
119 /* Get last ptrace message. */
120 PTRACE_GETEVENTMSG = 0x4201,
0466106e 121#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
9c316a45
UD
122
123 /* Get siginfo for process. */
124 PTRACE_GETSIGINFO = 0x4202,
125#define PT_GETSIGINFO PTRACE_GETSIGINFO
126
127 /* Set new siginfo for process. */
cbff0d96 128 PTRACE_SETSIGINFO = 0x4203,
9c316a45 129#define PT_SETSIGINFO PTRACE_SETSIGINFO
cbff0d96
UD
130
131 /* Get register content. */
132 PTRACE_GETREGSET = 0x4204,
133#define PTRACE_GETREGSET PTRACE_GETREGSET
134
135 /* Set register content. */
136 PTRACE_SETREGSET = 0x4205,
137#define PTRACE_SETREGSET PTRACE_SETREGSET
138
139 /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
140 signal or group stop state. */
141 PTRACE_SEIZE = 0x4206,
142#define PTRACE_SEIZE PTRACE_SEIZE
143
144 /* Trap seized tracee. */
145 PTRACE_INTERRUPT = 0x4207,
146#define PTRACE_INTERRUPT PTRACE_INTERRUPT
147
148 /* Wait for next group event. */
521c6785
AJ
149 PTRACE_LISTEN = 0x4208,
150#define PTRACE_LISTEN PTRACE_LISTEN
151
ac583f50 152 /* Retrieve siginfo_t structures without removing signals from a queue. */
fb53a27c 153 PTRACE_PEEKSIGINFO = 0x4209,
521c6785 154#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
fb53a27c 155
ac583f50 156 /* Get the mask of blocked signals. */
fb53a27c
JM
157 PTRACE_GETSIGMASK = 0x420a,
158#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
159
ac583f50 160 /* Change the mask of blocked signals. */
fb53a27c
JM
161 PTRACE_SETSIGMASK = 0x420b,
162#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
163
ac583f50 164 /* Get seccomp BPF filters. */
9320ca88 165 PTRACE_SECCOMP_GET_FILTER = 0x420c,
fb53a27c 166#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
9320ca88
JM
167
168 /* Get seccomp BPF filter metadata. */
d1e411e5 169 PTRACE_SECCOMP_GET_METADATA = 0x420d,
9320ca88 170#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
d1e411e5
JM
171
172 /* Get information about system call. */
173 PTRACE_GET_SYSCALL_INFO = 0x420e
174#define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
28f540f4
RM
175};
176
b26e274d 177
7e21972b 178#include <bits/ptrace-shared.h>
28f540f4
RM
179
180__END_DECLS
181
8a4b65b4 182#endif /* _SYS_PTRACE_H */