63 ptrace call, we refer to lwp_id of the thread. 64 65 5. for core file, we parse ELF files and read data from them. For processes we use 66 combination of ptrace and /proc calls. 67 68 *************************************************************************************/ 69 70 71 #if defined(sparc) || defined(sparcv9) || defined(ppc64) || defined(ppc64le) 72 #include <asm/ptrace.h> 73 #define user_regs_struct pt_regs 74 #endif 75 #if defined(aarch64) 76 #include <asm/ptrace.h> 77 #define user_regs_struct user_pt_regs 78 #endif 79 #if defined(s390x) 80 #include <asm/ptrace.h> 81 #endif 82 83 // This C bool type must be int for compatibility with Linux calls and 84 // it would be a mistake to equivalence it to C++ bool on many platforms 85 86 typedef int bool; 87 #define true 1 88 #define false 0 89 90 struct ps_prochandle; 91 92 // attach to a process 93 struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len); 94 95 // attach to a core dump 96 struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile); 97 98 // release a process or core 99 void Prelease(struct ps_prochandle* ph); 100 101 // functions not directly available in Solaris libproc 102 | 63 ptrace call, we refer to lwp_id of the thread. 64 65 5. for core file, we parse ELF files and read data from them. For processes we use 66 combination of ptrace and /proc calls. 67 68 *************************************************************************************/ 69 70 71 #if defined(sparc) || defined(sparcv9) || defined(ppc64) || defined(ppc64le) 72 #include <asm/ptrace.h> 73 #define user_regs_struct pt_regs 74 #endif 75 #if defined(aarch64) 76 #include <asm/ptrace.h> 77 #define user_regs_struct user_pt_regs 78 #endif 79 #if defined(s390x) 80 #include <asm/ptrace.h> 81 #endif 82 83 #if defined(arm) || defined(arm64) 84 struct user_regs_struct { 85 unsigned long regs[ELF_NGREG]; /* integer and fp regs */ 86 }; 87 #endif 88 89 // This C bool type must be int for compatibility with Linux calls and 90 // it would be a mistake to equivalence it to C++ bool on many platforms 91 92 typedef int bool; 93 #define true 1 94 #define false 0 95 96 struct ps_prochandle; 97 98 // attach to a process 99 struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len); 100 101 // attach to a core dump 102 struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile); 103 104 // release a process or core 105 void Prelease(struct ps_prochandle* ph); 106 107 // functions not directly available in Solaris libproc 108 |