Remove K&R compatibility.
[glibc.git] / sysdeps / unix / sysv / linux / sparc / sys / ptrace.h
blob685340a89edc478379bb3d801a5f3fa553bb53a3
1 /* `ptrace' debugger support interface. Linux/SPARC version.
2 Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
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 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _SYS_PTRACE_H
21 #define _SYS_PTRACE_H 1
23 #include <features.h>
25 #include <bits/wordsize.h>
27 /* Linux/SPARC kernels up to 2.3.18 do not care much
28 about what namespace polution, so use a kludge now. */
29 #undef PTRACE_GETREGS
30 #undef PTRACE_SETREGS
31 #undef PTRACE_GETFPREGS
32 #undef PTRACE_SETFPREGS
33 #undef PTRACE_READDATA
34 #undef PTRACE_WRITEDATA
35 #undef PTRACE_READTEXT
36 #undef PTRACE_WRITETEXT
37 #undef PTRACE_SUNDETACH
39 __BEGIN_DECLS
41 /* Type of the REQUEST argument to `ptrace.' */
42 enum __ptrace_request
44 /* Indicate that the process making this request should be traced.
45 All signals received by this process can be intercepted by its
46 parent, and its parent can use the other `ptrace' requests. */
47 PTRACE_TRACEME = 0,
48 #define PT_TRACE_ME PTRACE_TRACEME
50 /* Return the word in the process's text space at address ADDR. */
51 PTRACE_PEEKTEXT = 1,
52 #define PT_READ_I PTRACE_PEEKTEXT
54 /* Return the word in the process's data space at address ADDR. */
55 PTRACE_PEEKDATA = 2,
56 #define PT_READ_D PTRACE_PEEKDATA
58 /* Return the word in the process's user area at offset ADDR. */
59 PTRACE_PEEKUSER = 3,
60 #define PT_READ_U PTRACE_PEEKUSER
62 /* Write the word DATA into the process's text space at address ADDR. */
63 PTRACE_POKETEXT = 4,
64 #define PT_WRITE_I PTRACE_POKETEXT
66 /* Write the word DATA into the process's data space at address ADDR. */
67 PTRACE_POKEDATA = 5,
68 #define PT_WRITE_D PTRACE_POKEDATA
70 /* Write the word DATA into the process's user area at offset ADDR. */
71 PTRACE_POKEUSER = 6,
72 #define PT_WRITE_U PTRACE_POKEUSER
74 /* Continue the process. */
75 PTRACE_CONT = 7,
76 #define PT_CONTINUE PTRACE_CONT
78 /* Kill the process. */
79 PTRACE_KILL = 8,
80 #define PT_KILL PTRACE_KILL
82 /* Single step the process.
83 This is not supported on all machines. */
84 PTRACE_SINGLESTEP = 9,
85 #define PT_STEP PTRACE_SINGLESTEP
87 /* Detach from a process attached to with PTRACE_ATTACH. */
88 PTRACE_DETACH = 11,
89 #define PT_DETACH PTRACE_DETACH
91 /* This define is needed for older programs which were
92 trying to work around sparc-linux ptrace nastiness. */
93 #define PTRACE_SUNDETACH PTRACE_DETACH
95 #if __WORDSIZE == 32
97 /* Get all general purpose registers used by a processes.
98 This is not supported on all machines. */
99 PTRACE_GETREGS = 12,
100 #define PT_GETREGS PTRACE_GETREGS
102 /* Set all general purpose registers used by a processes.
103 This is not supported on all machines. */
104 PTRACE_SETREGS = 13,
105 #define PT_SETREGS PTRACE_SETREGS
107 /* Get all floating point registers used by a processes.
108 This is not supported on all machines. */
109 PTRACE_GETFPREGS = 14,
110 #define PT_GETFPREGS PTRACE_GETFPREGS
112 /* Set all floating point registers used by a processes.
113 This is not supported on all machines. */
114 PTRACE_SETFPREGS = 15,
115 #define PT_SETFPREGS PTRACE_SETFPREGS
117 #endif
119 /* Attach to a process that is already running. */
120 PTRACE_ATTACH = 16,
121 #define PT_ATTACH PTRACE_ATTACH
123 /* Read several bytes at a time. */
124 PTRACE_READTEXT = 18,
125 #define PTRACE_READTEXT PTRACE_READTEXT
126 #define PTRACE_READDATA PTRACE_READTEXT
128 /* Write several bytes at a time. */
129 PTRACE_WRITETEXT = 19,
130 #define PTRACE_WRITETEXT PTRACE_WRITETEXT
131 #define PTRACE_WRITEDATA PTRACE_WRITETEXT
133 #if __WORDSIZE == 64
135 /* Get all general purpose registers used by a processes.
136 This is not supported on all machines. */
137 PTRACE_GETREGS = 22,
138 #define PT_GETREGS PTRACE_GETREGS
140 /* Set all general purpose registers used by a processes.
141 This is not supported on all machines. */
142 PTRACE_SETREGS = 23,
143 #define PT_SETREGS PTRACE_SETREGS
145 #endif
147 /* Continue and stop at the next (return from) syscall. */
148 PTRACE_SYSCALL = 24
149 #define PTRACE_SYSCALL PTRACE_SYSCALL
151 #if __WORDSIZE == 64
153 /* Get all floating point registers used by a processes.
154 This is not supported on all machines. */
155 PTRACE_GETFPREGS = 25,
156 #define PT_GETFPREGS PTRACE_GETFPREGS
158 /* Set all floating point registers used by a processes.
159 This is not supported on all machines. */
160 PTRACE_SETFPREGS = 26,
161 #define PT_SETFPREGS PTRACE_SETFPREGS
163 #endif
166 /* Perform process tracing functions. REQUEST is one of the values
167 above, and determines the action to be taken.
168 For all requests except PTRACE_TRACEME, PID specifies the process to be
169 traced.
171 PID and the other arguments described above for the various requests should
172 appear (those that are used for the particular request) as:
173 pid_t PID, void *ADDR, int DATA, void *ADDR2
174 after REQUEST. */
175 extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
177 __END_DECLS
179 #endif /* _SYS_PTRACE_H */