1 /* `ptrace' debugger support interface. Linux/ia64 version. 2 Copyright (C) 2001 Free Software Foundation, Inc. 3 This file is part of the GNU C Library. 4 5 The GNU C Library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 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 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with the GNU C Library; if not, see 17 <http://www.gnu.org/licenses/>. */ 18 19 #ifndef _SYS_PTRACE_H 20 #define _SYS_PTRACE_H 1 21 22 #include <features.h> 23 #include <sys/ucontext.h> 24 25 __BEGIN_DECLS 26 27 /* Type of the REQUEST argument to `ptrace.' */ 28 enum __ptrace_request 29 { 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 35 36 /* Return the word in the process's text space at address ADDR. */ 37 PTRACE_PEEKTEXT = 1, 38 #define PT_READ_I PTRACE_PEEKTEXT 39 40 /* Return the word in the process's data space at address ADDR. */ 41 PTRACE_PEEKDATA = 2, 42 #define PT_READ_D PTRACE_PEEKDATA 43 44 /* Return the word in the process's user area at offset ADDR. */ 45 PTRACE_PEEKUSER = 3, 46 #define PT_READ_U PTRACE_PEEKUSER 47 48 /* Write the word DATA into the process's text space at address ADDR. */ 49 PTRACE_POKETEXT = 4, 50 #define PT_WRITE_I PTRACE_POKETEXT 51 52 /* Write the word DATA into the process's data space at address ADDR. */ 53 PTRACE_POKEDATA = 5, 54 #define PT_WRITE_D PTRACE_POKEDATA 55 56 /* Write the word DATA into the process's user area at offset ADDR. */ 57 PTRACE_POKEUSER = 6, 58 #define PT_WRITE_U PTRACE_POKEUSER 59 60 /* Continue the process. */ 61 PTRACE_CONT = 7, 62 #define PT_CONTINUE PTRACE_CONT 63 64 /* Kill the process. */ 65 PTRACE_KILL = 8, 66 #define PT_KILL PTRACE_KILL 67 68 /* Single step the process. 69 This is not supported on all machines. */ 70 PTRACE_SINGLESTEP = 9, 71 #define PT_STEP PTRACE_SINGLESTEP 72 73 /* Execute process until next taken branch. */ 74 PTRACE_SINGLEBLOCK = 12, 75 #define PT_STEPBLOCK PTRACE_SINGLEBLOCK 76 77 /* Get siginfo for process. */ 78 PTRACE_GETSIGINFO = 13, 79 #define PT_GETSIGINFO PTRACE_GETSIGINFO 80 81 /* Set new siginfo for process. */ 82 PTRACE_SETSIGINFO = 14, 83 #define PT_GETSIGINFO PTRACE_GETSIGINFO 84 85 /* Attach to a process that is already running. */ 86 PTRACE_ATTACH = 16, 87 #define PT_ATTACH PTRACE_ATTACH 88 89 /* Detach from a process attached to with PTRACE_ATTACH. */ 90 PTRACE_DETACH = 17, 91 #define PT_DETACH PTRACE_DETACH 92 93 /* Get all registers (pt_all_user_regs) in one shot */ 94 PTRACE_GETREGS = 18, 95 #define PT_GETREGS PTRACE_GETREGS 96 97 /* Set all registers (pt_all_user_regs) in one shot */ 98 PTRACE_SETREGS = 19, 99 #define PT_SETREGS PTRACE_SETREGS 100 101 /* Continue and stop at the next (return from) syscall. */ 102 PTRACE_SYSCALL = 24 103 #define PT_SYSCALL PTRACE_SYSCALL 104 }; 105 106 /* pt_all_user_regs is used for PTRACE_GETREGS/PTRACE_SETREGS. */ 107 struct pt_all_user_regs 108 { 109 unsigned long nat; 110 unsigned long cr_iip; 111 unsigned long cfm; 112 unsigned long cr_ipsr; 113 unsigned long pr; 114 115 unsigned long gr[32]; 116 unsigned long br[8]; 117 unsigned long ar[128]; 118 struct ia64_fpreg fr[128]; 119 }; 120 121 /* Perform process tracing functions. REQUEST is one of the values 122 above, and determines the action to be taken. 123 For all requests except PTRACE_TRACEME, PID specifies the process to be 124 traced. 125 126 PID and the other arguments described above for the various requests should 127 appear (those that are used for the particular request) as: 128 pid_t PID, void *ADDR, int DATA, void *ADDR2 129 after REQUEST. */ 130 extern long int ptrace (enum __ptrace_request __request, ...) __THROW; 131 132 __END_DECLS 133 134 #endif /* _SYS_PTRACE_H */ 135