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