1 PROC_SERVICE(3PROC) Process Control Library Functions PROC_SERVICE(3PROC) 2 3 NAME 4 proc_service - process service interfaces 5 6 SYNOPSIS 7 #include <proc_service.h> 8 9 ps_err_e ps_pdmodel(struct ps_prochandle *ph, 10 int *data_model); 11 12 13 ps_err_e ps_pglobal_lookup(struct ps_prochandle *ph, 14 const char *object_name, const char *sym_name, 15 psaddr_t *sym_addr); 16 17 18 ps_err_e ps_pglobal_sym(struct ps_prochandle *ph, 19 const char *object_name, const char *sym_name, 20 ps_sym_t *sym); 21 22 23 ps_err_e ps_pread(struct ps_prochandle *ph, psaddr_t addr, 24 void *buf, size_t size); 25 26 27 ps_err_e ps_pwrite(struct ps_prochandle *ph, psaddr_t addr, 28 const void *buf, size_t size); 29 30 31 ps_err_e ps_pdread(struct ps_prochandle *ph, psaddr_t addr, 32 void *buf, size_t size); 33 34 35 ps_err_e ps_pdwrite(struct ps_prochandle *ph, psaddr_t addr, 36 const void *buf, size_t size); 37 38 39 ps_err_e ps_ptread(struct ps_prochandle *ph, psaddr_t addr, 40 void *buf, size_t size); 41 42 43 ps_err_e ps_ptwrite(struct ps_prochandle *ph, psaddr_t addr, 44 const void *buf, size_t size); 45 46 47 ps_err_e ps_pstop(struct ps_prochandle *ph); 48 49 50 ps_err_e ps_pcontinue(struct ps_prochandle *ph); 51 52 53 ps_err_e ps_lstop(struct ps_prochandle *ph, lwpid_t lwpid); 54 55 56 ps_err_e ps_lcontinue(struct ps_prochandle *ph, lwpid_t lwpid); 57 58 59 ps_err_e ps_lgetregs(struct ps_prochandle *ph, lwpid_t lwpid, 60 prgregset_t gregset); 61 62 63 ps_err_e ps_lsetregs(struct ps_prochandle *ph, lwpid_t lwpid, 64 const prgregset_t gregset); 65 66 67 ps_err_e ps_lgetfpregs(struct ps_prochandle *ph, lwpid_t lwpid, 68 prfpregset_t *fpregset); 69 70 71 ps_err_e ps_lsetfpregs(struct ps_prochandle *ph, lwpid_t lwpid, 72 const prfpregset_t *fpregset); 73 74 75 ps_err_e ps_pauxv(struct ps_prochandle *ph, 76 const auxv_t **auxp); 77 78 79 ps_err_e ps_kill(struct ps_prochandle *ph, int sig); 80 81 82 ps_err_e ps_lrolltoaddr(struct ps_prochandle *ph, 83 lwpid_t lwpid, psaddr_t go_addr, psaddr_t stop_addr); 84 85 86 void ps_plog(const char *fmt); 87 88 89 ps_err_e ps_lgetxregsize(struct ps_prochandle *ph, 90 lwpid_t lwpid, int *xregsize); 91 92 93 ps_err_e ps_lgetxregs(struct ps_prochandle *ph, 94 lwpid_t lwpid, caddr_t xregset); 95 96 97 ps_err_e ps_lsetxregs(struct ps_prochandle *ph, 98 lwpid_t lwpid, caddr_t xregset); 99 100 101 x86 102 ps_err_e ps_lgetLDT(struct ps_prochandle *ph, lwpid_t lwpid, 103 struct ssd *ldt); 104 105 106 DESCRIPTION 107 Every program that links libthread_db or librtld_db must provide a set 108 of process control primitives that allow libthread_db and librtld_db to 109 access memory and registers in the target process, to start and to stop 110 the target process, and to look up symbols in the target process. See 111 libc_db(3LIB). For information on librtld_db, refer to the Linker and 112 Libraries Guide. 113 114 115 Refer to the individual reference manual pages that describe these 116 routines for a functional specification that clients of libthread_db 117 and librtld_db can use to implement this required interface. The 118 <proc_service.h> header lists the C declarations of these routines. 119 120 FUNCTIONS 121 ps_pdmodel() 122 Returns the data model of the target process. 123 124 125 ps_pglobal_lookup() 126 Looks up the symbol in the symbol table of the 127 load object in the target process and returns 128 its address. 129 130 131 ps_pglobal_sym() 132 Looks up the symbol in the symbol table of the 133 load object in the target process and returns 134 its symbol table entry. 135 136 137 ps_pread() 138 Copies size bytes from the target process to the 139 controlling process. 140 141 142 ps_pwrite() 143 Copies size bytes from the controlling process 144 to the target process. 145 146 147 ps_pdread() 148 Identical to ps_pread(). 149 150 151 ps_pdwrite() 152 Identical to ps_pwrite(). 153 154 155 ps_ptread() 156 Identical to ps_pread(). 157 158 159 ps_ptwrite() 160 Identical to ps_pwrite(). 161 162 163 ps_pstop() 164 Stops the target process. 165 166 167 ps_pcontinue() 168 Resumes target process. 169 170 171 ps_lstop() 172 Stops a single lightweight process ( LWP ) 173 within the target process. 174 175 176 ps_lcontinue() 177 Resumes a single LWP within the target process. 178 179 180 ps_lgetregs() 181 Gets the general registers of the LWP. 182 183 184 ps_lsetregs() 185 Sets the general registers of the LWP. 186 187 188 ps_lgetfpregs() 189 Gets the LWP`s floating point register set. 190 191 192 ps_lsetfpregs() 193 Sets the LWP`s floating point register set. 194 195 196 ps_pauxv() 197 Returns a pointer to a read-only copy of the 198 auxiliary vector of the target process. 199 200 201 ps_kill() 202 Sends signal to target process. 203 204 205 ps_lrolltoaddr() 206 Rolls the LWP out of a critical section when the 207 process is stopped. 208 209 210 ps_plog() 211 Logs a message. 212 213 ps_lgetxregsize() 214 Returns the size of the architecture-dependent 215 extra state registers. 216 217 218 ps_lgetxregs() 219 Gets the extra state registers of the LWP. 220 221 222 ps_lsetxregs() 223 Sets the extra state registers of the LWP. 224 225 226 x86 227 ps_lgetLDT() 228 Reads the local descriptor table of the LWP. 229 230 231 ATTRIBUTES 232 See attributes(7) for description of the following attributes: 233 234 235 236 237 +---------------+-----------------+ 238 |ATTRIBUTE TYPE | ATTRIBUTE VALUE | 239 +---------------+-----------------+ 240 |MT Level | Safe | 241 +---------------+-----------------+ 242 243 SEE ALSO 244 rtld_db(3EXT), libc_db(3LIB), librtld_db(3LIB), ps_pread(3PROC), 245 attributes(7) 246 247 248 Linker and Libraries Guide 249 250 January 23, 2023 PROC_SERVICE(3PROC)