1 '\" te 2 .\" Copyright (c) 2007 by Sun Microsystems, Inc. All Rights Reserved. 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 6 .TH PROC_SERVICE 3PROC "Jan 23, 2023" 7 .SH NAME 8 proc_service \- process service interfaces 9 .SH SYNOPSIS 10 .nf 11 #include <proc_service.h> 12 13 \fBps_err_e\fR \fBps_pdmodel\fR(\fBstruct ps_prochandle *\fR\fIph\fR, 14 \fBint *\fR\fIdata_model\fR); 15 .fi 16 17 .LP 18 .nf 19 \fBps_err_e\fR \fBps_pglobal_lookup\fR(\fBstruct ps_prochandle *\fR\fIph\fR, 20 \fBconst char *\fR\fIobject_name\fR, \fBconst char *\fR\fIsym_name\fR, 21 \fBpsaddr_t *\fR\fIsym_addr\fR); 22 .fi 23 24 .LP 25 .nf 26 \fBps_err_e\fR \fBps_pglobal_sym\fR(\fBstruct ps_prochandle *\fR\fIph\fR, 27 \fBconst char *\fR\fIobject_name\fR, \fBconst char *\fR\fIsym_name\fR, 28 \fBps_sym_t *\fR\fIsym\fR); 29 .fi 30 31 .LP 32 .nf 33 \fBps_err_e\fR \fBps_pread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, 34 \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); 35 .fi 36 37 .LP 38 .nf 39 \fBps_err_e\fR \fBps_pwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, 40 \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); 41 .fi 42 43 .LP 44 .nf 45 \fBps_err_e\fR \fBps_pdread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, 46 \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); 47 .fi 48 49 .LP 50 .nf 51 \fBps_err_e\fR \fBps_pdwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, 52 \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); 53 .fi 54 55 .LP 56 .nf 57 \fBps_err_e\fR \fBps_ptread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, 58 \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); 59 .fi 60 61 .LP 62 .nf 63 \fBps_err_e\fR \fBps_ptwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, 64 \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); 65 .fi 66 67 .LP 68 .nf 69 \fBps_err_e\fR \fBps_pstop\fR(\fBstruct ps_prochandle *\fR\fIph\fR); 70 .fi 71 72 .LP 73 .nf 74 \fBps_err_e\fR \fBps_pcontinue\fR(\fBstruct ps_prochandle *\fR\fIph\fR); 75 .fi 76 77 .LP 78 .nf 79 \fBps_err_e\fR \fBps_lstop\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR); 80 .fi 81 82 .LP 83 .nf 84 \fBps_err_e\fR \fBps_lcontinue\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR); 85 .fi 86 87 .LP 88 .nf 89 \fBps_err_e\fR \fBps_lgetregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, 90 \fBprgregset_t\fR \fIgregset\fR); 91 .fi 92 93 .LP 94 .nf 95 \fBps_err_e\fR \fBps_lsetregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, 96 \fBconst prgregset_t\fR \fIgregset\fR); 97 .fi 98 99 .LP 100 .nf 101 \fBps_err_e\fR \fBps_lgetfpregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, 102 \fBprfpregset_t *\fR\fIfpregset\fR); 103 .fi 104 105 .LP 106 .nf 107 \fBps_err_e\fR \fBps_lsetfpregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, 108 \fBconst prfpregset_t *\fR\fIfpregset\fR); 109 .fi 110 111 .LP 112 .nf 113 \fBps_err_e\fR \fBps_pauxv\fR(\fBstruct ps_prochandle *\fR\fIph\fR, 114 \fBconst auxv_t **\fR\fIauxp\fR); 115 .fi 116 117 .LP 118 .nf 119 \fBps_err_e\fR \fBps_kill\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBint\fR \fIsig\fR); 120 .fi 121 122 .LP 123 .nf 124 \fBps_err_e\fR \fBps_lrolltoaddr\fR(\fBstruct ps_prochandle *\fR\fIph\fR, 125 \fBlwpid_t\fR \fIlwpid\fR, \fBpsaddr_t\fR \fIgo_addr\fR, \fBpsaddr_t\fR \fIstop_addr\fR); 126 .fi 127 128 .LP 129 .nf 130 \fBvoid\fR \fBps_plog\fR(\fBconst char *\fR\fIfmt\fR); 131 .fi 132 133 .LP 134 .nf 135 \fBps_err_e\fR \fBps_lgetxregsize\fR(\fBstruct ps_prochandle *\fR\fIph\fR, 136 \fBlwpid_t\fR \fIlwpid\fR, \fBint *\fR\fIxregsize\fR); 137 .fi 138 139 .LP 140 .nf 141 \fBps_err_e\fR \fBps_lgetxregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, 142 \fBlwpid_t\fR \fIlwpid\fR, \fBcaddr_t\fR \fIxregset\fR); 143 .fi 144 145 .LP 146 .nf 147 \fBps_err_e\fR \fBps_lsetxregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, 148 \fBlwpid_t\fR \fIlwpid\fR, \fBcaddr_t\fR \fIxregset\fR); 149 .fi 150 151 .SS "x86" 152 .nf 153 \fBps_err_e\fR \fBps_lgetLDT\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, 154 \fBstruct ssd *\fR\fIldt\fR); 155 .fi 156 157 .SH DESCRIPTION 158 Every program that links \fBlibthread_db\fR or \fBlibrtld_db\fR must provide a 159 set of process control primitives that allow \fBlibthread_db\fR and 160 \fBlibrtld_db\fR to access memory and registers in the target process, to start 161 and to stop the target process, and to look up symbols in the target process. 162 See \fBlibc_db\fR(3LIB). For information on \fBlibrtld_db\fR, refer to the 163 \fILinker and Libraries Guide\fR. 164 .sp 165 .LP 166 Refer to the individual reference manual pages that describe these routines for 167 a functional specification that clients of \fBlibthread_db\fR and 168 \fBlibrtld_db\fR can use to implement this required interface. The 169 <\fBproc_service.h\fR> header lists the C declarations of these routines. 170 .SH FUNCTIONS 171 .ne 2 172 .na 173 \fB\fBps_pdmodel()\fR\fR 174 .ad 175 .RS 23n 176 Returns the data model of the target process. 177 .RE 178 179 .sp 180 .ne 2 181 .na 182 \fB\fBps_pglobal_lookup()\fR\fR 183 .ad 184 .RS 23n 185 Looks up the symbol in the symbol table of the load object in the target 186 process and returns its address. 187 .RE 188 189 .sp 190 .ne 2 191 .na 192 \fB\fBps_pglobal_sym()\fR\fR 193 .ad 194 .RS 23n 195 Looks up the symbol in the symbol table of the load object in the target 196 process and returns its symbol table entry. 197 .RE 198 199 .sp 200 .ne 2 201 .na 202 \fB\fBps_pread()\fR\fR 203 .ad 204 .RS 23n 205 Copies \fIsize\fR bytes from the target process to the controlling process. 206 .RE 207 208 .sp 209 .ne 2 210 .na 211 \fB\fBps_pwrite()\fR\fR 212 .ad 213 .RS 23n 214 Copies \fIsize\fR bytes from the controlling process to the target process. 215 .RE 216 217 .sp 218 .ne 2 219 .na 220 \fB\fBps_pdread()\fR\fR 221 .ad 222 .RS 23n 223 Identical to \fBps_pread()\fR. 224 .RE 225 226 .sp 227 .ne 2 228 .na 229 \fB\fBps_pdwrite()\fR\fR 230 .ad 231 .RS 23n 232 Identical to \fBps_pwrite()\fR. 233 .RE 234 235 .sp 236 .ne 2 237 .na 238 \fB\fBps_ptread()\fR\fR 239 .ad 240 .RS 23n 241 Identical to \fBps_pread()\fR. 242 .RE 243 244 .sp 245 .ne 2 246 .na 247 \fB\fBps_ptwrite()\fR\fR 248 .ad 249 .RS 23n 250 Identical to \fBps_pwrite()\fR. 251 .RE 252 253 .sp 254 .ne 2 255 .na 256 \fB\fBps_pstop()\fR\fR 257 .ad 258 .RS 23n 259 Stops the target process. 260 .RE 261 262 .sp 263 .ne 2 264 .na 265 \fB\fBps_pcontinue()\fR\fR 266 .ad 267 .RS 23n 268 Resumes target process. 269 .RE 270 271 .sp 272 .ne 2 273 .na 274 \fB\fBps_lstop()\fR\fR 275 .ad 276 .RS 23n 277 Stops a single lightweight process ( \fBLWP\fR ) within the target process. 278 .RE 279 280 .sp 281 .ne 2 282 .na 283 \fB\fBps_lcontinue()\fR\fR 284 .ad 285 .RS 23n 286 Resumes a single \fBLWP\fR within the target process. 287 .RE 288 289 .sp 290 .ne 2 291 .na 292 \fB\fBps_lgetregs()\fR\fR 293 .ad 294 .RS 23n 295 Gets the general registers of the \fBLWP\fR. 296 .RE 297 298 .sp 299 .ne 2 300 .na 301 \fB\fBps_lsetregs()\fR\fR 302 .ad 303 .RS 23n 304 Sets the general registers of the \fBLWP\fR. 305 .RE 306 307 .sp 308 .ne 2 309 .na 310 \fB\fBps_lgetfpregs()\fR\fR 311 .ad 312 .RS 23n 313 Gets the \fBLWP`s\fR floating point register set. 314 .RE 315 316 .sp 317 .ne 2 318 .na 319 \fB\fBps_lsetfpregs()\fR\fR 320 .ad 321 .RS 23n 322 Sets the \fBLWP`s\fR floating point register set. 323 .RE 324 325 .sp 326 .ne 2 327 .na 328 \fB\fBps_pauxv()\fR\fR 329 .ad 330 .RS 23n 331 Returns a pointer to a read-only copy of the auxiliary vector of the target 332 process. 333 .RE 334 335 .sp 336 .ne 2 337 .na 338 \fB\fBps_kill()\fR\fR 339 .ad 340 .RS 23n 341 Sends signal to target process. 342 .RE 343 344 .sp 345 .ne 2 346 .na 347 \fB\fBps_lrolltoaddr()\fR\fR 348 .ad 349 .RS 23n 350 Rolls the \fBLWP\fR out of a critical section when the process is stopped. 351 .RE 352 353 .sp 354 .ne 2 355 .na 356 \fB\fBps_plog()\fR\fR 357 .ad 358 .RS 23n 359 Logs a message. 360 .RE 361 362 .ne 2 363 .na 364 \fB\fBps_lgetxregsize()\fR\fR 365 .ad 366 .RS 21n 367 Returns the size of the architecture-dependent extra state registers. 368 .RE 369 370 .sp 371 .ne 2 372 .na 373 \fB\fBps_lgetxregs()\fR\fR 374 .ad 375 .RS 21n 376 Gets the extra state registers of the \fBLWP\fR. 377 .RE 378 379 .sp 380 .ne 2 381 .na 382 \fB\fBps_lsetxregs()\fR\fR 383 .ad 384 .RS 21n 385 Sets the extra state registers of the \fBLWP\fR. 386 .RE 387 388 .SS "x86" 389 .ne 2 390 .na 391 \fB\fBps_lgetLDT()\fR\fR 392 .ad 393 .RS 16n 394 Reads the local descriptor table of the \fBLWP\fR. 395 .RE 396 397 .SH ATTRIBUTES 398 See \fBattributes\fR(7) for description of the following attributes: 399 .sp 400 401 .sp 402 .TS 403 box; 404 c | c 405 l | l . 406 ATTRIBUTE TYPE ATTRIBUTE VALUE 407 _ 408 MT Level Safe 409 .TE 410 411 .SH SEE ALSO 412 .BR rtld_db (3EXT), 413 .BR libc_db (3LIB), 414 .BR librtld_db (3LIB), 415 .BR ps_pread (3PROC), 416 .BR attributes (7) 417 .sp 418 .LP 419 \fILinker and Libraries Guide\fR