]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
Fix mcontext_t sigcontext namespace (bug 21457).
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / ia64 / sys / ptrace.h
1 /* `ptrace' debugger support interface. Linux/ia64 version.
2 Copyright (C) 2001-2017 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
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.
9
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.
14
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/>. */
18
19 #ifndef _SYS_PTRACE_H
20 #define _SYS_PTRACE_H 1
21
22 #include <features.h>
23 #include <sys/ucontext.h>
24 #include <bits/sigcontext.h>
25 #include <bits/types.h>
26
27 __BEGIN_DECLS
28
29 /* Type of the REQUEST argument to `ptrace.' */
30 enum __ptrace_request
31 {
32 /* Indicate that the process making this request should be traced.
33 All signals received by this process can be intercepted by its
34 parent, and its parent can use the other `ptrace' requests. */
35 PTRACE_TRACEME = 0,
36 #define PT_TRACE_ME PTRACE_TRACEME
37
38 /* Return the word in the process's text space at address ADDR. */
39 PTRACE_PEEKTEXT = 1,
40 #define PT_READ_I PTRACE_PEEKTEXT
41
42 /* Return the word in the process's data space at address ADDR. */
43 PTRACE_PEEKDATA = 2,
44 #define PT_READ_D PTRACE_PEEKDATA
45
46 /* Return the word in the process's user area at offset ADDR. */
47 PTRACE_PEEKUSER = 3,
48 #define PT_READ_U PTRACE_PEEKUSER
49
50 /* Write the word DATA into the process's text space at address ADDR. */
51 PTRACE_POKETEXT = 4,
52 #define PT_WRITE_I PTRACE_POKETEXT
53
54 /* Write the word DATA into the process's data space at address ADDR. */
55 PTRACE_POKEDATA = 5,
56 #define PT_WRITE_D PTRACE_POKEDATA
57
58 /* Write the word DATA into the process's user area at offset ADDR. */
59 PTRACE_POKEUSER = 6,
60 #define PT_WRITE_U PTRACE_POKEUSER
61
62 /* Continue the process. */
63 PTRACE_CONT = 7,
64 #define PT_CONTINUE PTRACE_CONT
65
66 /* Kill the process. */
67 PTRACE_KILL = 8,
68 #define PT_KILL PTRACE_KILL
69
70 /* Single step the process.
71 This is not supported on all machines. */
72 PTRACE_SINGLESTEP = 9,
73 #define PT_STEP PTRACE_SINGLESTEP
74
75 /* Execute process until next taken branch. */
76 PTRACE_SINGLEBLOCK = 12,
77 #define PT_STEPBLOCK PTRACE_SINGLEBLOCK
78
79 /* Attach to a process that is already running. */
80 PTRACE_ATTACH = 16,
81 #define PT_ATTACH PTRACE_ATTACH
82
83 /* Detach from a process attached to with PTRACE_ATTACH. */
84 PTRACE_DETACH = 17,
85 #define PT_DETACH PTRACE_DETACH
86
87 /* Get all registers (pt_all_user_regs) in one shot */
88 PTRACE_GETREGS = 18,
89 #define PT_GETREGS PTRACE_GETREGS
90
91 /* Set all registers (pt_all_user_regs) in one shot */
92 PTRACE_SETREGS = 19,
93 #define PT_SETREGS PTRACE_SETREGS
94
95 /* Continue and stop at the next (return from) syscall. */
96 PTRACE_SYSCALL = 24,
97 #define PT_SYSCALL PTRACE_SYSCALL
98
99 /* Set ptrace filter options. */
100 PTRACE_SETOPTIONS = 0x4200,
101 #define PT_SETOPTIONS PTRACE_SETOPTIONS
102
103 /* Get last ptrace message. */
104 PTRACE_GETEVENTMSG = 0x4201,
105 #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
106
107 /* Get siginfo for process. */
108 PTRACE_GETSIGINFO = 0x4202,
109 #define PT_GETSIGINFO PTRACE_GETSIGINFO
110
111 /* Set new siginfo for process. */
112 PTRACE_SETSIGINFO = 0x4203,
113 #define PT_SETSIGINFO PTRACE_SETSIGINFO
114
115 /* Get register content. */
116 PTRACE_GETREGSET = 0x4204,
117 #define PTRACE_GETREGSET PTRACE_GETREGSET
118
119 /* Set register content. */
120 PTRACE_SETREGSET = 0x4205,
121 #define PTRACE_SETREGSET PTRACE_SETREGSET
122
123 /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
124 signal or group stop state. */
125 PTRACE_SEIZE = 0x4206,
126 #define PTRACE_SEIZE PTRACE_SEIZE
127
128 /* Trap seized tracee. */
129 PTRACE_INTERRUPT = 0x4207,
130 #define PTRACE_INTERRUPT PTRACE_INTERRUPT
131
132 /* Wait for next group event. */
133 PTRACE_LISTEN = 0x4208,
134 #define PTRACE_LISTEN PTRACE_LISTEN
135
136 PTRACE_PEEKSIGINFO = 0x4209,
137 #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
138
139 PTRACE_GETSIGMASK = 0x420a,
140 #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
141
142 PTRACE_SETSIGMASK = 0x420b,
143 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
144
145 PTRACE_SECCOMP_GET_FILTER = 0x420c
146 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
147 };
148
149
150 /* pt_all_user_regs is used for PTRACE_GETREGS/PTRACE_SETREGS. */
151 struct __pt_all_user_regs
152 {
153 unsigned long nat;
154 unsigned long cr_iip;
155 unsigned long cfm;
156 unsigned long cr_ipsr;
157 unsigned long pr;
158
159 unsigned long gr[32];
160 unsigned long br[8];
161 unsigned long ar[128];
162 struct __ia64_fpreg fr[128];
163 };
164
165 /* Options set using PTRACE_SETOPTIONS. */
166 enum __ptrace_setoptions
167 {
168 PTRACE_O_TRACESYSGOOD = 0x00000001,
169 PTRACE_O_TRACEFORK = 0x00000002,
170 PTRACE_O_TRACEVFORK = 0x00000004,
171 PTRACE_O_TRACECLONE = 0x00000008,
172 PTRACE_O_TRACEEXEC = 0x00000010,
173 PTRACE_O_TRACEVFORKDONE = 0x00000020,
174 PTRACE_O_TRACEEXIT = 0x00000040,
175 PTRACE_O_TRACESECCOMP = 0x00000080,
176 PTRACE_O_EXITKILL = 0x00100000,
177 PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
178 PTRACE_O_MASK = 0x003000ff
179 };
180
181 enum __ptrace_eventcodes
182 {
183 /* Wait extended result codes for the above trace options. */
184 PTRACE_EVENT_FORK = 1,
185 PTRACE_EVENT_VFORK = 2,
186 PTRACE_EVENT_CLONE = 3,
187 PTRACE_EVENT_EXEC = 4,
188 PTRACE_EVENT_VFORK_DONE = 5,
189 PTRACE_EVENT_EXIT = 6,
190 PTRACE_EVENT_SECCOMP = 7,
191 /* Extended result codes enabled by means other than options. */
192 PTRACE_EVENT_STOP = 128
193 };
194
195 /* Arguments for PTRACE_PEEKSIGINFO. */
196 struct __ptrace_peeksiginfo_args
197 {
198 __uint64_t off; /* From which siginfo to start. */
199 __uint32_t flags; /* Flags for peeksiginfo. */
200 __int32_t nr; /* How many siginfos to take. */
201 };
202
203 enum __ptrace_peeksiginfo_flags
204 {
205 /* Read signals from a shared (process wide) queue. */
206 PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
207 };
208
209 /* Perform process tracing functions. REQUEST is one of the values
210 above, and determines the action to be taken.
211 For all requests except PTRACE_TRACEME, PID specifies the process to be
212 traced.
213
214 PID and the other arguments described above for the various requests should
215 appear (those that are used for the particular request) as:
216 pid_t PID, void *ADDR, int DATA, void *ADDR2
217 after REQUEST. */
218 extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
219
220 __END_DECLS
221
222 #endif /* _SYS_PTRACE_H */