1 /* `ptrace' debugger support interface. Linux/SPARC version.
2 Copyright (C) 1996, 1997, 1998, 1999, 2000 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 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.
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.
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/>. */
20 #define _SYS_PTRACE_H 1
24 #include <bits/wordsize.h>
26 /* Linux/SPARC kernels up to 2.3.18 do not care much
27 about what namespace polution, so use a kludge now. */
30 #undef PTRACE_GETFPREGS
31 #undef PTRACE_SETFPREGS
32 #undef PTRACE_READDATA
33 #undef PTRACE_WRITEDATA
34 #undef PTRACE_READTEXT
35 #undef PTRACE_WRITETEXT
36 #undef PTRACE_SUNDETACH
40 /* Type of the REQUEST argument to `ptrace.' */
43 /* Indicate that the process making this request should be traced.
44 All signals received by this process can be intercepted by its
45 parent, and its parent can use the other `ptrace' requests. */
47 #define PT_TRACE_ME PTRACE_TRACEME
49 /* Return the word in the process's text space at address ADDR. */
51 #define PT_READ_I PTRACE_PEEKTEXT
53 /* Return the word in the process's data space at address ADDR. */
55 #define PT_READ_D PTRACE_PEEKDATA
57 /* Return the word in the process's user area at offset ADDR. */
59 #define PT_READ_U PTRACE_PEEKUSER
61 /* Write the word DATA into the process's text space at address ADDR. */
63 #define PT_WRITE_I PTRACE_POKETEXT
65 /* Write the word DATA into the process's data space at address ADDR. */
67 #define PT_WRITE_D PTRACE_POKEDATA
69 /* Write the word DATA into the process's user area at offset ADDR. */
71 #define PT_WRITE_U PTRACE_POKEUSER
73 /* Continue the process. */
75 #define PT_CONTINUE PTRACE_CONT
77 /* Kill the process. */
79 #define PT_KILL PTRACE_KILL
81 /* Single step the process.
82 This is not supported on all machines. */
83 PTRACE_SINGLESTEP = 9,
84 #define PT_STEP PTRACE_SINGLESTEP
86 /* Detach from a process attached to with PTRACE_ATTACH. */
88 #define PT_DETACH PTRACE_DETACH
90 /* This define is needed for older programs which were
91 trying to work around sparc-linux ptrace nastiness. */
92 #define PTRACE_SUNDETACH PTRACE_DETACH
96 /* Get all general purpose registers used by a processes.
97 This is not supported on all machines. */
99 #define PT_GETREGS PTRACE_GETREGS
101 /* Set all general purpose registers used by a processes.
102 This is not supported on all machines. */
104 #define PT_SETREGS PTRACE_SETREGS
106 /* Get all floating point registers used by a processes.
107 This is not supported on all machines. */
108 PTRACE_GETFPREGS = 14,
109 #define PT_GETFPREGS PTRACE_GETFPREGS
111 /* Set all floating point registers used by a processes.
112 This is not supported on all machines. */
113 PTRACE_SETFPREGS = 15,
114 #define PT_SETFPREGS PTRACE_SETFPREGS
118 /* Attach to a process that is already running. */
120 #define PT_ATTACH PTRACE_ATTACH
122 /* Write several bytes at a time. */
123 PTRACE_WRITEDATA = 17,
124 #define PTRACE_WRITEDATA PTRACE_WRITEDATA
126 /* Read several bytes at a time. */
127 PTRACE_READTEXT = 18,
128 #define PTRACE_READTEXT PTRACE_READTEXT
129 #define PTRACE_READDATA PTRACE_READTEXT
131 /* Write several bytes at a time. */
132 PTRACE_WRITETEXT = 19,
133 #define PTRACE_WRITETEXT PTRACE_WRITETEXT
137 /* Get all general purpose registers used by a processes.
138 This is not supported on all machines. */
140 #define PT_GETREGS PTRACE_GETREGS
142 /* Set all general purpose registers used by a processes.
143 This is not supported on all machines. */
145 #define PT_SETREGS PTRACE_SETREGS
149 /* Continue and stop at the next (return from) syscall. */
151 #define PTRACE_SYSCALL PTRACE_SYSCALL
156 /* Get all floating point registers used by a processes.
157 This is not supported on all machines. */
158 PTRACE_GETFPREGS = 25,
159 #define PT_GETFPREGS PTRACE_GETFPREGS
161 /* Set all floating point registers used by a processes.
162 This is not supported on all machines. */
163 PTRACE_SETFPREGS = 26
164 #define PT_SETFPREGS PTRACE_SETFPREGS
169 /* Perform process tracing functions. REQUEST is one of the values
170 above, and determines the action to be taken.
171 For all requests except PTRACE_TRACEME, PID specifies the process to be
174 PID and the other arguments described above for the various requests should
175 appear (those that are used for the particular request) as:
176 pid_t PID, void *ADDR, int DATA, void *ADDR2
178 extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
182 #endif /* _SYS_PTRACE_H */