1 /* `ptrace' debugger support interface. Generic version; constants are common.
2 Copyright (C) 1991, 1992, 1996 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. */
28 /* Type of the REQUEST argument to `ptrace.' */
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. */
35 #define PT_TRACE_ME PTRACE_TRACEME
37 /* Return the word in the process's text space at address ADDR. */
39 #define PT_READ_I PTRACE_PEEKTEXT
41 /* Return the word in the process's data space at address ADDR. */
43 #define PT_READ_D PTRACE_PEEKDATA
45 /* Return the word in the process's user area at offset ADDR. */
47 #define PT_READ_U PTRACE_PEEKUSER
49 /* Write the word DATA into the process's text space at address ADDR. */
51 #define PT_WRITE_I PTRACE_POKETEXT
53 /* Write the word DATA into the process's data space at address ADDR. */
55 #define PT_WRITE_D PTRACE_POKEDATA
57 /* Write the word DATA into the process's user space at offset ADDR. */
59 #define PT_WRITE_U PTRACE_POKEUSER
61 /* Continue the process. */
63 #define PT_CONTINUE PTRACE_CONT
65 /* Kill the process. */
67 #define PT_KILL PTRACE_KILL
69 /* Single step the process.
70 This is not supported on all machines. */
72 #define PT_STEP PTRACE_SINGLESTEP
74 /* Attach to a process that is already running. */
76 #define PT_ATTACH PTRACE_ATTACH
78 /* Detach from a process attached to with PTRACE_ATTACH. */
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. */
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. */
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. */
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
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. */
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
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. */
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. */
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
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
134 extern int ptrace
__P ((enum __ptrace_request __request __DOTS
));
138 #endif /* ptrace.h */