kernel debug: priv can be NULL early on
[minix.git] / include / sys / ptrace.h
blob59c1a442aafeb47b84c98fb5235d28a3b12010e7
1 /* <sys/ptrace.h>
2 * definitions for ptrace(2)
3 */
5 #ifndef _PTRACE_H
6 #define _PTRACE_H
8 /* Trace requests. */
9 #define T_STOP -1 /* stop the process */
10 #define T_OK 0 /* enable tracing by parent for this process */
11 #define T_GETINS 1 /* return value from instruction space */
12 #define T_GETDATA 2 /* return value from data space */
13 #define T_GETUSER 3 /* return value from user process table */
14 #define T_SETINS 4 /* set value from instruction space */
15 #define T_SETDATA 5 /* set value from data space */
16 #define T_SETUSER 6 /* set value in user process table */
17 #define T_RESUME 7 /* resume execution */
18 #define T_EXIT 8 /* exit */
19 #define T_STEP 9 /* set trace bit */
20 #define T_SYSCALL 10 /* trace system call */
21 #define T_ATTACH 11 /* attach to a running process */
22 #define T_DETACH 12 /* detach from a traced process */
23 #define T_SETOPT 13 /* set trace options */
24 #define T_GETRANGE 14 /* get range of values */
25 #define T_SETRANGE 15 /* set range of values */
26 #define T_DUMPCORE 16 /* dumps the core for the process with the given pid */
28 #define T_READB_INS 100 /* Read a byte from the text segment of an
29 * untraced process (only for root)
31 #define T_WRITEB_INS 101 /* Write a byte in the text segment of an
32 * untraced process (only for root)
35 /* Trace options. */
36 #define TO_TRACEFORK 0x1 /* automatically attach to forked children */
37 #define TO_ALTEXEC 0x2 /* send SIGSTOP on successful exec() */
38 #define TO_NOEXEC 0x4 /* do not send signal on successful exec() */
40 /* Trace spaces. */
41 #define TS_INS 0 /* text space */
42 #define TS_DATA 1 /* data space */
44 /* Trance range structure. */
45 struct ptrace_range {
46 int pr_space; /* space in traced process */
47 long pr_addr; /* address in traced process */
48 void *pr_ptr; /* buffer in caller process */
49 size_t pr_size; /* size of range, in bytes */
52 /* Function Prototypes. */
53 #include <sys/cdefs.h>
55 __BEGIN_DECLS
56 long ptrace(int _req, pid_t _pid, long _addr, long _data);
57 __END_DECLS
59 #endif /* _PTRACE_H */