2.9
[glibc/nacl-glibc.git] / sysdeps / unix / sysv / linux / s390 / sys / ptrace.h
blobac186387fcbae86665314fe0dc8a4fe3c35c08c9
1 /* `ptrace' debugger support interface. Linux version.
2 Copyright (C) 2000, 2006, 2007 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, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 #ifndef _SYS_PTRACE_H
22 #define _SYS_PTRACE_H 1
24 #include <features.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
141 /* Options set using PTRACE_SETOPTIONS. */
142 enum __ptrace_setoptions {
143 PTRACE_O_TRACESYSGOOD = 0x00000001,
144 PTRACE_O_TRACEFORK = 0x00000002,
145 PTRACE_O_TRACEVFORK = 0x00000004,
146 PTRACE_O_TRACECLONE = 0x00000008,
147 PTRACE_O_TRACEEXEC = 0x00000010,
148 PTRACE_O_TRACEVFORKDONE = 0x00000020,
149 PTRACE_O_TRACEEXIT = 0x00000040,
150 PTRACE_O_MASK = 0x0000007f
153 /* Wait extended result codes for the above trace options. */
154 enum __ptrace_eventcodes {
155 PTRACE_EVENT_FORK = 1,
156 PTRACE_EVENT_VFORK = 2,
157 PTRACE_EVENT_CLONE = 3,
158 PTRACE_EVENT_EXEC = 4,
159 PTRACE_EVENT_VFORK_DONE = 5,
160 PTRACE_EVENT_EXIT = 6
163 /* Perform process tracing functions. REQUEST is one of the values
164 above, and determines the action to be taken.
165 For all requests except PTRACE_TRACEME, PID specifies the process to be
166 traced.
168 PID and the other arguments described above for the various requests should
169 appear (those that are used for the particular request) as:
170 pid_t PID, void *ADDR, int DATA, void *ADDR2
171 after REQUEST. */
172 extern long int ptrace (enum __ptrace_request __request, ...);
174 __END_DECLS
176 #endif /* _SYS_PTRACE_H */