Tue Jul 9 09:37:55 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
[glibc.git] / sysdeps / unix / sysv / linux / sys / ptrace.h
blobcf3709e80229b32ff81502abc1082a3ed7937dc1
1 /* `ptrace' debugger support interface. Linux version.
2 Copyright (C) 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
17 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18 Cambridge, MA 02139, USA. */
20 #ifndef _SYS_PTRACE_H
21 #define _SYS_PTRACE_H
23 #include <features.h>
25 __BEGIN_DECLS
27 /* Type of the REQUEST argument to `ptrace.' */
28 enum __ptrace_request
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. */
33 PTRACE_TRACEME = 0,
34 #define PT_TRACE_ME PTRACE_TRACEME
36 /* Return the word in the process's text space at address ADDR. */
37 PTRACE_PEEKTEXT,
38 #define PT_READ_I PTRACE_PEEKTEXT
40 /* Return the word in the process's data space at address ADDR. */
41 PTRACE_PEEKDATA,
42 #define PT_READ_D PTRACE_PEEKDATA
44 /* Return the word in the process's user area at offset ADDR. */
45 PTRACE_PEEKUSER,
46 #define PT_READ_U PTRACE_PEEKUSER
48 /* Write the word DATA into the process's text space at address ADDR. */
49 PTRACE_POKETEXT,
50 #define PT_WRITE_I PTRACE_POKETEXT
52 /* Write the word DATA into the process's data space at address ADDR. */
53 PTRACE_POKEDATA,
54 #define PT_WRITE_D PTRACE_POKEDATA
56 /* Write the word DATA into the process's user area at offset ADDR. */
57 PTRACE_POKEUSER,
58 #define PT_WRITE_U PTRACE_POKEUSER
60 /* Continue the process. */
61 PTRACE_CONT,
62 #define PT_CONTINUE PTRACE_CONT
64 /* Kill the process. */
65 PTRACE_KILL,
66 #define PT_KILL PTRACE_KILL
68 /* Single step the process.
69 This is not supported on all machines. */
70 PTRACE_SINGLESTEP,
71 #define PT_STEP PTRACE_SINGLESTEP
73 /* Attach to a process that is already running. */
74 PTRACE_ATTACH = 0x10,
75 #define PT_ATTACH PTRACE_ATTACH
77 /* Detach from a process attached to with PTRACE_ATTACH. */
78 PTRACE_DETACH,
79 #define PT_DETACH PTRACE_DETACH
81 /* Continue and stop at the next (return from) syscall. */
82 PTRACE_SYSCALL = 24,
85 /* Perform process tracing functions. REQUEST is one of the values
86 above, and determines the action to be taken.
87 For all requests except PTRACE_TRACEME, PID specifies the process to be
88 traced.
90 PID and the other arguments described above for the various requests should
91 appear (those that are used for the particular request) as:
92 pid_t PID, void *ADDR, int DATA, void *ADDR2
93 after REQUEST. */
94 extern int ptrace __P ((enum __ptrace_request __request __DOTS));
96 __END_DECLS
98 #endif /* sys/ptrace.h */