1 /* `ptrace' debugger support interface. Generic version; constants are common.
2 Copyright (C) 1991-2015 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/>. */
27 /* Type of the REQUEST argument to `ptrace.' */
30 /* Indicate that the process making this request should be traced.
31 All signals received by this process can be intercepted by its
32 parent, and its parent can use the other `ptrace' requests. */
34 #define PT_TRACE_ME PTRACE_TRACEME
36 /* Return the word in the process's text space at address ADDR. */
38 #define PT_READ_I PTRACE_PEEKTEXT
40 /* Return the word in the process's data space at address ADDR. */
42 #define PT_READ_D PTRACE_PEEKDATA
44 /* Return the word in the process's user area at offset ADDR. */
46 #define PT_READ_U PTRACE_PEEKUSER
48 /* Write the word DATA into the process's text space at address ADDR. */
50 #define PT_WRITE_I PTRACE_POKETEXT
52 /* Write the word DATA into the process's data space at address ADDR. */
54 #define PT_WRITE_D PTRACE_POKEDATA
56 /* Write the word DATA into the process's user space at offset ADDR. */
58 #define PT_WRITE_U PTRACE_POKEUSER
60 /* Continue the process. */
62 #define PT_CONTINUE PTRACE_CONT
64 /* Kill the process. */
66 #define PT_KILL PTRACE_KILL
68 /* Single step the process.
69 This is not supported on all machines. */
71 #define PT_STEP PTRACE_SINGLESTEP
73 /* Attach to a process that is already running. */
75 #define PT_ATTACH PTRACE_ATTACH
77 /* Detach from a process attached to with PTRACE_ATTACH. */
79 #define PT_DETACH PTRACE_DETACH
81 /* Get the process's registers (not including floating-point registers)
82 and put them in the `struct regs' (see <machine/regs.h>) at ADDR. */
85 /* Set the process's registers (not including floating-point registers)
86 to the contents of the `struct regs' (see <machine/regs.h>) at ADDR. */
89 /* Get the process's floating point registers and put them
90 in the `struct fp_status' (see <machine/regs.h>) at ADDR. */
91 PTRACE_GETFPREGS
= 14,
93 /* Set the process's floating point registers to the contents
94 of the `struct fp_status' (see <machine/regs.h>) at ADDR. */
97 /* Read DATA bytes from the process's data space at address ADDR.
98 Put the result starting at address ADDR2 in the caller's
100 PTRACE_READDATA
= 16,
102 /* Write DATA bytes from ADDR2 in the caller's address space into
103 the process's data space at address ADDR. */
106 /* Read DATA bytes from the process's text space at address ADDR.
107 Put the result starting at address ADDR2 in the caller's
109 PTRACE_READTEXT
= 18,
111 /* Write DATA bytes from ADDR2 in the caller's address space into
112 the process's text space at address ADDR. */
115 /* Read the floating-point accelerator unit registers and
116 put them into the `struct fpa_regs' (see <machine/regs.h>) at ADDR. */
117 PTRACE_GETFPAREGS
= 20,
119 /* Write the floating-point accelerator unit registers from
120 the contents of the `struct fpa_regs' at ADDR. */
124 /* Perform process tracing functions. REQUEST is one of the values
125 above, and determines the action to be taken.
126 For all requests except PTRACE_TRACEME, PID specifies the process to be
129 PID and the other arguments described above for the various requests should
130 appear (those that are used for the particular request) as:
131 pid_t PID, void *ADDR, int DATA, void *ADDR2
133 extern int ptrace (enum __ptrace_request __request
, ...);
137 #endif /* ptrace.h */