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, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 #define _SYS_PTRACE_H 1
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. */
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
41 /* Type of the REQUEST argument to `ptrace.' */
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. */
48 #define PT_TRACE_ME PTRACE_TRACEME
50 /* Return the word in the process's text space at address ADDR. */
52 #define PT_READ_I PTRACE_PEEKTEXT
54 /* Return the word in the process's data space at address ADDR. */
56 #define PT_READ_D PTRACE_PEEKDATA
58 /* Return the word in the process's user area at offset ADDR. */
60 #define PT_READ_U PTRACE_PEEKUSER
62 /* Write the word DATA into the process's text space at address ADDR. */
64 #define PT_WRITE_I PTRACE_POKETEXT
66 /* Write the word DATA into the process's data space at address ADDR. */
68 #define PT_WRITE_D PTRACE_POKEDATA
70 /* Write the word DATA into the process's user area at offset ADDR. */
72 #define PT_WRITE_U PTRACE_POKEUSER
74 /* Continue the process. */
76 #define PT_CONTINUE PTRACE_CONT
78 /* Kill the process. */
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. */
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
97 /* Get all general purpose registers used by a processes.
98 This is not supported on all machines. */
100 #define PT_GETREGS PTRACE_GETREGS
102 /* Set all general purpose registers used by a processes.
103 This is not supported on all machines. */
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
119 /* Attach to a process that is already running. */
121 #define PT_ATTACH PTRACE_ATTACH
123 /* Write several bytes at a time. */
124 PTRACE_WRITEDATA
= 17,
125 #define PTRACE_WRITEDATA PTRACE_WRITEDATA
127 /* Read several bytes at a time. */
128 PTRACE_READTEXT
= 18,
129 #define PTRACE_READTEXT PTRACE_READTEXT
130 #define PTRACE_READDATA PTRACE_READTEXT
132 /* Write several bytes at a time. */
133 PTRACE_WRITETEXT
= 19,
134 #define PTRACE_WRITETEXT PTRACE_WRITETEXT
138 /* Get all general purpose registers used by a processes.
139 This is not supported on all machines. */
141 #define PT_GETREGS PTRACE_GETREGS
143 /* Set all general purpose registers used by a processes.
144 This is not supported on all machines. */
146 #define PT_SETREGS PTRACE_SETREGS
150 /* Continue and stop at the next (return from) syscall. */
152 #define PTRACE_SYSCALL PTRACE_SYSCALL
157 /* Get all floating point registers used by a processes.
158 This is not supported on all machines. */
159 PTRACE_GETFPREGS
= 25,
160 #define PT_GETFPREGS PTRACE_GETFPREGS
162 /* Set all floating point registers used by a processes.
163 This is not supported on all machines. */
164 PTRACE_SETFPREGS
= 26
165 #define PT_SETFPREGS PTRACE_SETFPREGS
170 /* Perform process tracing functions. REQUEST is one of the values
171 above, and determines the action to be taken.
172 For all requests except PTRACE_TRACEME, PID specifies the process to be
175 PID and the other arguments described above for the various requests should
176 appear (those that are used for the particular request) as:
177 pid_t PID, void *ADDR, int DATA, void *ADDR2
179 extern long int ptrace (enum __ptrace_request __request
, ...) __THROW
;
183 #endif /* _SYS_PTRACE_H */