|
|
1.1 root 1: /*
2: * Coherent.
3: * Process trace.
4: */
5: #ifndef __SYS_PTRACE_H__
6: #define __SYS_PTRACE_H__
7:
8: #include <sys/types.h>
9: #include <sys/ksynch.h>
10:
11:
12: /*
13: * Structure used for communication between parent and child.
14: */
15: struct ptrace {
16: int pt_req; /* Request */
17: int pt_pid; /* Process id */
18: caddr_t pt_addr; /* Address */
19: int pt_data; /* Data */
20: int pt_errs; /* Error status */
21: int pt_rval; /* Return value */
22: int pt_busy; /* In use */
23: GATE pt_gate; /* Gate */
24: };
25:
26:
27: /*
28: * Commands for ptrace() system call. First argument is one of these.
29: */
30: #define PTRACE_SETUP 0 /* init called by child */
31: #define PTRACE_RD_TXT 1 /* parent reads child text */
32: #define PTRACE_RD_DAT 2 /* parent reads child data */
33: #define PTRACE_RD_USR 3 /* parent reads child u area */
34: #define PTRACE_WR_TXT 4 /* parent writes child text */
35: #define PTRACE_WR_DAT 5 /* parent writes child data */
36: #define PTRACE_WR_USR 6 /* parent writes child u area */
37: #define PTRACE_RESUME 7 /* resume child, maybe fake signal to child */
38: #define PTRACE_TERM 8 /* terminate child */
39: #define PTRACE_SSTEP 9 /* single-step child, maybe fake sig to child */
40:
41: /*
42: * Pseudo offsets of registers in USR segment.
43: *
44: * When ptracing a process, the parent can access the register set
45: * of the child using PTRACE_RD_USR and PTRACE_WR_USR commands and
46: * an addr (third argument to the system call) from the following list.
47: *
48: * There are two ESP values available:
49: * PTRACE_UESP selects the user stack pointer - value from the child
50: * process saved on entry to, e.g., the debug trap handler.
51: * PTRACE_SS gives access to the corresponding stack selector.
52: * PTRACE_ESP is the stack pointer used by the trap handler itself.
53: *
54: * PTRACE_ERR will have the fault or trap number in case of exceptions.
55: *
56: * PTRACE_SIG is the current signal number.
57: *
58: * PTRACE_UEND is the size of accessible u area plus one - addresses
59: * greater than or equal to this value are not valid in ptrace
60: * read/write of USR segment.
61: */
62: /* CPU trap frame - see sys/reg.h and ieeefp.h (struct _fpstackframe) */
63: #define PTRACE_GS 0
64: #define PTRACE_FS 4
65: #define PTRACE_ES 8
66: #define PTRACE_DS 12
67: #define PTRACE_EDI 16
68: #define PTRACE_ESI 20
69: #define PTRACE_EBP 24
70: #define PTRACE_ESP 28
71: #define PTRACE_EBX 32
72: #define PTRACE_EDX 36
73: #define PTRACE_ECX 40
74: #define PTRACE_EAX 44
75: #define PTRACE_TRAPNO 48
76: #define PTRACE_ERR 52
77: #define PTRACE_EIP 56
78: #define PTRACE_CS 60
79: #define PTRACE_EFL 64
80: #define PTRACE_UESP 68
81: #define PTRACE_SS 72
82: #define PTRACE_SIG 76
83:
84: /* NDP context - see ieeefp.h (struct _fpstate) */
85: #define PTRACE_FP_CW 80
86: #define PTRACE_FP_SW 84
87: #define PTRACE_FP_TAG 88
88: #define PTRACE_FP_EIP 92
89: #define PTRACE_FP_CS 96
90: #define PTRACE_FP_FOO 100
91: #define PTRACE_FP_FS 104
92: #define PTRACE_FP_ST0 108
93: #define PTRACE_FP_ST1 118
94: #define PTRACE_FP_ST2 128
95: #define PTRACE_FP_ST3 138
96: #define PTRACE_FP_ST4 148
97: #define PTRACE_FP_ST5 158
98: #define PTRACE_FP_ST6 168
99: #define PTRACE_FP_ST7 178
100: #define PTRACE_FP_STAT 188
101:
102: /* Debug context */
103: #define PTRACE_DR0 192
104: #define PTRACE_DR1 196
105: #define PTRACE_DR2 200
106: #define PTRACE_DR3 204
107: #define PTRACE_DR4 208
108: #define PTRACE_DR5 212
109: #define PTRACE_DR6 216
110: #define PTRACE_DR7 220
111:
112: #define PTRACE_UEND 224 /* Offsets >= UEND are not valid */
113:
114: #ifdef KERNEL
115: /*
116: * Global variables.
117: */
118: extern struct ptrace pts; /* Ptrace structure */
119:
120: #endif
121:
122: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.