00001 /* <sys/ptrace.h> 00002 * definitions for ptrace(2) 00003 */ 00004 00005 #ifndef _PTRACE_H 00006 #define _PTRACE_H 00007 00008 /* Trace requests. */ 00009 #define T_STOP -1 /* stop the process */ 00010 #define T_OK 0 /* enable tracing by parent for this process */ 00011 #define T_GETINS 1 /* return value from instruction space */ 00012 #define T_GETDATA 2 /* return value from data space */ 00013 #define T_GETUSER 3 /* return value from user process table */ 00014 #define T_SETINS 4 /* set value from instruction space */ 00015 #define T_SETDATA 5 /* set value from data space */ 00016 #define T_SETUSER 6 /* set value in user process table */ 00017 #define T_RESUME 7 /* resume execution */ 00018 #define T_EXIT 8 /* exit */ 00019 #define T_STEP 9 /* set trace bit */ 00020 #define T_SYSCALL 10 /* trace system call */ 00021 #define T_ATTACH 11 /* attach to a running process */ 00022 #define T_DETACH 12 /* detach from a traced process */ 00023 #define T_SETOPT 13 /* set trace options */ 00024 #define T_GETRANGE 14 /* get range of values */ 00025 #define T_SETRANGE 15 /* set range of values */ 00026 00027 #define T_READB_INS 100 /* Read a byte from the text segment of an 00028 * untraced process (only for root) 00029 */ 00030 #define T_WRITEB_INS 101 /* Write a byte in the text segment of an 00031 * untraced process (only for root) 00032 */ 00033 00034 /* Trace options. */ 00035 #define TO_TRACEFORK 0x1 /* automatically attach to forked children */ 00036 #define TO_ALTEXEC 0x2 /* send SIGSTOP on successful exec() */ 00037 #define TO_NOEXEC 0x4 /* do not send signal on successful exec() */ 00038 00039 /* Trace spaces. */ 00040 #define TS_INS 0 /* text space */ 00041 #define TS_DATA 1 /* data space */ 00042 00043 /* Trance range structure. */ 00044 struct ptrace_range { 00045 int pr_space; /* space in traced process */ 00046 long pr_addr; /* address in traced process */ 00047 void *pr_ptr; /* buffer in caller process */ 00048 size_t pr_size; /* size of range, in bytes */ 00049 }; 00050 00051 /* Function Prototypes. */ 00052 #ifndef _ANSI_H 00053 #include <ansi.h> 00054 #endif 00055 00056 _PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) ); 00057 00058 #endif /* _PTRACE_H */
1.5.8