59 unfortunately libthread_db does not work very well for core dumps. So, we get pthread_id
60 only for processes. For core dumps, we don't use libthread_db at all (like gdb).
61
62 4. ptrace operates on this LWP id under both the thread libraries. When we say 'pid' for
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
80 // This C bool type must be int for compatibility with Linux calls and
81 // it would be a mistake to equivalence it to C++ bool on many platforms
82
83 typedef int bool;
84 #define true 1
85 #define false 0
86
87 struct ps_prochandle;
88
89 // attach to a process
90 struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len);
91
92 // attach to a core dump
93 struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile);
94
95 // release a process or core
96 void Prelease(struct ps_prochandle* ph);
97
98 // functions not directly available in Solaris libproc
|
59 unfortunately libthread_db does not work very well for core dumps. So, we get pthread_id
60 only for processes. For core dumps, we don't use libthread_db at all (like gdb).
61
62 4. ptrace operates on this LWP id under both the thread libraries. When we say 'pid' for
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
|