Update.
[glibc.git] / sysdeps / generic / sys / ptrace.h
blob47263e8dc349eebc86305cdffee48a03c30e897b
1 /* `ptrace' debugger support interface. Generic version; constants are common.
2 Copyright (C) 1991, 1992, 1996, 1998 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 _PTRACE_H
22 #define _PTRACE_H 1
23 #include <features.h>
25 __BEGIN_DECLS
28 /* Type of the REQUEST argument to `ptrace.' */
29 enum __ptrace_request
31 /* Indicate that the process making this request should be traced.
32 All signals received by this process can be intercepted by its
33 parent, and its parent can use the other `ptrace' requests. */
34 PTRACE_TRACEME = 0,
35 #define PT_TRACE_ME PTRACE_TRACEME
37 /* Return the word in the process's text space at address ADDR. */
38 PTRACE_PEEKTEXT,
39 #define PT_READ_I PTRACE_PEEKTEXT
41 /* Return the word in the process's data space at address ADDR. */
42 PTRACE_PEEKDATA,
43 #define PT_READ_D PTRACE_PEEKDATA
45 /* Return the word in the process's user area at offset ADDR. */
46 PTRACE_PEEKUSER,
47 #define PT_READ_U PTRACE_PEEKUSER
49 /* Write the word DATA into the process's text space at address ADDR. */
50 PTRACE_POKETEXT,
51 #define PT_WRITE_I PTRACE_POKETEXT
53 /* Write the word DATA into the process's data space at address ADDR. */
54 PTRACE_POKEDATA,
55 #define PT_WRITE_D PTRACE_POKEDATA
57 /* Write the word DATA into the process's user space at offset ADDR. */
58 PTRACE_POKEUSER,
59 #define PT_WRITE_U PTRACE_POKEUSER
61 /* Continue the process. */
62 PTRACE_CONT,
63 #define PT_CONTINUE PTRACE_CONT
65 /* Kill the process. */
66 PTRACE_KILL,
67 #define PT_KILL PTRACE_KILL
69 /* Single step the process.
70 This is not supported on all machines. */
71 PTRACE_SINGLESTEP,
72 #define PT_STEP PTRACE_SINGLESTEP
74 /* Attach to a process that is already running. */
75 PTRACE_ATTACH,
76 #define PT_ATTACH PTRACE_ATTACH
78 /* Detach from a process attached to with PTRACE_ATTACH. */
79 PTRACE_DETACH,
80 #define PT_DETACH PTRACE_DETACH
82 /* Get the process's registers (not including floating-point registers)
83 and put them in the `struct regs' (see <machine/regs.h>) at ADDR. */
84 PTRACE_GETREGS = 12,
86 /* Set the process's registers (not including floating-point registers)
87 to the contents of the `struct regs' (see <machine/regs.h>) at ADDR. */
88 PTRACE_SETREGS,
90 /* Get the process's floating point registers and put them
91 in the `struct fp_status' (see <machine/regs.h>) at ADDR. */
92 PTRACE_GETFPREGS = 14,
94 /* Set the process's floating point registers to the contents
95 of the `struct fp_status' (see <machine/regs.h>) at ADDR. */
96 PTRACE_SETFPREGS,
98 /* Read DATA bytes from the process's data space at address ADDR.
99 Put the result starting at address ADDR2 in the caller's
100 address space. */
101 PTRACE_READDATA = 16,
103 /* Write DATA bytes from ADDR2 in the caller's address space into
104 the process's data space at address ADDR. */
105 PTRACE_WRITEDATA,
107 /* Read DATA bytes from the process's text space at address ADDR.
108 Put the result starting at address ADDR2 in the caller's
109 address space. */
110 PTRACE_READTEXT = 18,
112 /* Write DATA bytes from ADDR2 in the caller's address space into
113 the process's text space at address ADDR. */
114 PTRACE_WRITETEXT,
116 /* Read the floating-point accelerator unit registers and
117 put them into the `struct fpa_regs' (see <machine/regs.h>) at ADDR. */
118 PTRACE_GETFPAREGS = 20,
120 /* Write the floating-point accelerator unit registers from
121 the contents of the `struct fpa_regs' at ADDR. */
122 PTRACE_SETFPAREGS
125 /* Perform process tracing functions. REQUEST is one of the values
126 above, and determines the action to be taken.
127 For all requests except PTRACE_TRACEME, PID specifies the process to be
128 traced.
130 PID and the other arguments described above for the various requests should
131 appear (those that are used for the particular request) as:
132 pid_t PID, void *ADDR, int DATA, void *ADDR2
133 after REQUEST. */
134 extern int ptrace __P ((enum __ptrace_request __request __DOTS));
136 __END_DECLS
138 #endif /* ptrace.h */