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