diff options
Diffstat (limited to 'usr/src/man/man3proc')
-rw-r--r-- | usr/src/man/man3proc/Makefile | 72 | ||||
-rw-r--r-- | usr/src/man/man3proc/proc_service.3proc | 479 | ||||
-rw-r--r-- | usr/src/man/man3proc/ps_lgetregs.3proc | 142 | ||||
-rw-r--r-- | usr/src/man/man3proc/ps_pglobal_lookup.3proc | 96 | ||||
-rw-r--r-- | usr/src/man/man3proc/ps_pread.3proc | 122 | ||||
-rw-r--r-- | usr/src/man/man3proc/ps_pstop.3proc | 142 |
6 files changed, 1053 insertions, 0 deletions
diff --git a/usr/src/man/man3proc/Makefile b/usr/src/man/man3proc/Makefile new file mode 100644 index 0000000000..ac4d16c968 --- /dev/null +++ b/usr/src/man/man3proc/Makefile @@ -0,0 +1,72 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet +# at http://www.illumos.org/license/CDDL. +# + +# Copyright 2011, Richard Lowe + +include ../../Makefile.master + +MANSECT = 3proc + +MANFILES = proc_service.3proc \ + ps_lgetregs.3proc \ + ps_pglobal_lookup.3proc \ + ps_pread.3proc \ + ps_pstop.3proc + +MANSOFILES = ps_kill.3proc \ + ps_lcontinue.3proc \ + ps_lgetfpregs.3proc \ + ps_lgetxregs.3proc \ + ps_lgetxregsize.3proc \ + ps_lrolltoaddr.3proc \ + ps_lsetfpregs.3proc \ + ps_lsetregs.3proc \ + ps_lsetxregs.3proc \ + ps_lstop.3proc \ + ps_pcontinue.3proc \ + ps_pdread.3proc \ + ps_pdwrite.3proc \ + ps_pglobal_sym.3proc \ + ps_ptread.3proc \ + ps_ptwrite.3proc \ + ps_pwrite.3proc + +MANFILES += $(MANSOFILES) + +ps_lgetfpregs.3proc := SOSRC = man3proc/ps_lgetregs.3proc +ps_lgetxregs.3proc := SOSRC = man3proc/ps_lgetregs.3proc +ps_lgetxregsize.3proc := SOSRC = man3proc/ps_lgetregs.3proc +ps_lsetfpregs.3proc := SOSRC = man3proc/ps_lgetregs.3proc +ps_lsetregs.3proc := SOSRC = man3proc/ps_lgetregs.3proc +ps_lsetxregs.3proc := SOSRC = man3proc/ps_lgetregs.3proc + +ps_pglobal_sym.3proc := SOSRC = man3proc/ps_pglobal_lookup.3proc + +ps_pdread.3proc := SOSRC = man3proc/ps_pread.3proc +ps_pdwrite.3proc := SOSRC = man3proc/ps_pread.3proc +ps_ptread.3proc := SOSRC = man3proc/ps_pread.3proc +ps_ptwrite.3proc := SOSRC = man3proc/ps_pread.3proc +ps_pwrite.3proc := SOSRC = man3proc/ps_pread.3proc + +ps_kill.3proc := SOSRC = man3proc/ps_pstop.3proc +ps_lcontinue.3proc := SOSRC = man3proc/ps_pstop.3proc +ps_lrolltoaddr.3proc := SOSRC = man3proc/ps_pstop.3proc +ps_lstop.3proc := SOSRC = man3proc/ps_pstop.3proc +ps_pcontinue.3proc := SOSRC = man3proc/ps_pstop.3proc + + +.KEEP_STATE: + +include ../Makefile.man + +install: $(ROOTMANFILES) + + diff --git a/usr/src/man/man3proc/proc_service.3proc b/usr/src/man/man3proc/proc_service.3proc new file mode 100644 index 0000000000..f34a70c56d --- /dev/null +++ b/usr/src/man/man3proc/proc_service.3proc @@ -0,0 +1,479 @@ +'\" te +.\" Copyright (c) 2007 by Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH proc_service 3PROC "12 Oct 2007" "SunOS 5.11" "Process Control Library Functions" +.SH NAME +proc_service \- process service interfaces +.SH SYNOPSIS +.LP +.nf +#include <proc_service.h> + +\fBps_err_e\fR \fBps_pdmodel\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBint *\fR\fIdata_model\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pglobal_lookup\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBconst char *\fR\fIobject_name\fR, \fBconst char *\fR\fIsym_name\fR, + \fBpsaddr_t *\fR\fIsym_addr\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pglobal_sym\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBconst char *\fR\fIobject_name\fR, \fBconst char *\fR\fIsym_name\fR, + \fBps_sym_t *\fR\fIsym\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pdread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pdwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_ptread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_ptwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pstop\fR(\fBstruct ps_prochandle *\fR\fIph\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pcontinue\fR(\fBstruct ps_prochandle *\fR\fIph\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lstop\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lcontinue\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lgetregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, + \fBprgregset_t\fR \fIgregset\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lsetregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, + \fBconst prgregset_t\fR \fIgregset\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lgetfpregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, + \fBprfpregset_t *\fR\fIfpregset\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lsetfpregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, + \fBconst prfpregset_t *\fR\fIfpregset\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pauxv\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBconst auxv_t **\fR\fIauxp\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_kill\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBint\fR \fIsig\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lrolltoaddr\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBlwpid_t\fR \fIlwpid\fR, \fBpsaddr_t\fR \fIgo_addr\fR, \fBpsaddr_t\fR \fIstop_addr\fR); +.fi + +.LP +.nf +\fBvoid\fR \fBps_plog\fR(\fBconst char *\fR\fIfmt\fR); +.fi + +.SS "SPARC" +.LP +.nf +\fBps_err_e\fR \fBps_lgetxregsize\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBlwpid_t\fR \fIlwpid\fR, \fBint *\fR\fIxregsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lgetxregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBlwpid_t\fR \fIlwpid\fR, \fBcaddr_t\fR \fIxregset\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lsetxregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBlwpid_t\fR \fIlwpid\fR, \fBcaddr_t\fR \fIxregset\fR); +.fi + +.SS "x86" +.LP +.nf +\fBps_err_e\fR \fBps_lgetLDT\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR, + \fBstruct ssd *\fR\fIldt\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +Every program that links \fBlibthread_db\fR or \fBlibrtld_db\fR must provide a +set of process control primitives that allow \fBlibthread_db\fR and +\fBlibrtld_db\fR to access memory and registers in the target process, to start +and to stop the target process, and to look up symbols in the target process. +See \fBlibc_db\fR(3LIB). For information on \fBlibrtld_db\fR, refer to the +\fILinker and Libraries Guide\fR. +.sp +.LP +Refer to the individual reference manual pages that describe these routines for +a functional specification that clients of \fBlibthread_db\fR and +\fBlibrtld_db\fR can use to implement this required interface. The +<\fBproc_service.h\fR> header lists the C declarations of these routines. +.SH FUNCTIONS +.sp +.ne 2 +.mk +.na +\fB\fBps_pdmodel()\fR\fR +.ad +.RS 23n +.rt +Returns the data model of the target process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pglobal_lookup()\fR\fR +.ad +.RS 23n +.rt +Looks up the symbol in the symbol table of the load object in the target +process and returns its address. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pglobal_sym()\fR\fR +.ad +.RS 23n +.rt +Looks up the symbol in the symbol table of the load object in the target +process and returns its symbol table entry. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pread()\fR\fR +.ad +.RS 23n +.rt +Copies \fIsize\fR bytes from the target process to the controlling process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pwrite()\fR\fR +.ad +.RS 23n +.rt +Copies \fIsize\fR bytes from the controlling process to the target process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pdread()\fR\fR +.ad +.RS 23n +.rt +Identical to \fBps_pread()\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pdwrite()\fR\fR +.ad +.RS 23n +.rt +Identical to \fBps_pwrite()\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_ptread()\fR\fR +.ad +.RS 23n +.rt +Identical to \fBps_pread()\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_ptwrite()\fR\fR +.ad +.RS 23n +.rt +Identical to \fBps_pwrite()\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pstop()\fR\fR +.ad +.RS 23n +.rt +Stops the target process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pcontinue()\fR\fR +.ad +.RS 23n +.rt +Resumes target process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lstop()\fR\fR +.ad +.RS 23n +.rt +Stops a single lightweight process ( \fBLWP\fR ) within the target process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lcontinue()\fR\fR +.ad +.RS 23n +.rt +Resumes a single \fBLWP\fR within the target process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lgetregs()\fR\fR +.ad +.RS 23n +.rt +Gets the general registers of the \fBLWP\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lsetregs()\fR\fR +.ad +.RS 23n +.rt +Sets the general registers of the \fBLWP\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lgetfpregs()\fR\fR +.ad +.RS 23n +.rt +Gets the \fBLWP`s\fR floating point register set. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lsetfpregs()\fR\fR +.ad +.RS 23n +.rt +Sets the \fBLWP`s\fR floating point register set. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_pauxv()\fR\fR +.ad +.RS 23n +.rt +Returns a pointer to a read-only copy of the target process's auxiliary vector. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_kill()\fR\fR +.ad +.RS 23n +.rt +Sends signal to target process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lrolltoaddr()\fR\fR +.ad +.RS 23n +.rt +Rolls the \fBLWP\fR out of a critical section when the process is stopped. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_plog()\fR\fR +.ad +.RS 23n +.rt +Logs a message. +.RE + +.SS "SPARC" +.sp +.ne 2 +.mk +.na +\fB\fBps_lgetxregsize()\fR\fR +.ad +.RS 21n +.rt +Returns the size of the architecture-dependent extra state registers. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lgetxregs()\fR\fR +.ad +.RS 21n +.rt +Gets the extra state registers of the \fBLWP\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBps_lsetxregs()\fR\fR +.ad +.RS 21n +.rt +Sets the extra state registers of the \fBLWP\fR. +.RE + +.SS "x86" +.sp +.ne 2 +.mk +.na +\fB\fBps_lgetLDT()\fR\fR +.ad +.RS 16n +.rt +Reads the local descriptor table of the \fBLWP\fR. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for description of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +MT LevelSafe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlibc_db\fR(3LIB), \fBlibrtld_db\fR(3LIB), \fBps_pread\fR(3PROC), +\fBrtld_db\fR(3EXT), \fBattributes\fR(5) +.sp +.LP +\fILinker and Libraries Guide\fR diff --git a/usr/src/man/man3proc/ps_lgetregs.3proc b/usr/src/man/man3proc/ps_lgetregs.3proc new file mode 100644 index 0000000000..d0ea42ec39 --- /dev/null +++ b/usr/src/man/man3proc/ps_lgetregs.3proc @@ -0,0 +1,142 @@ +'\" te +.\" Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved +.\" 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. +.\" 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. +.\" 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] +.TH ps_lgetregs 3PROC "30 Jan 1998" "SunOS 5.11" "Process Control Library Functions" +.SH NAME +ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs, ps_lgetxregsize, +ps_lgetxregs, ps_lsetxregs \- routines that access the target process register +in libthread_db +.SH SYNOPSIS +.LP +.nf +#include <proc_service.h> + +\fB ps_err_e\fR \fBps_lgetregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlid\fR, + \fBprgregset_t\fR \fIgregset\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lsetregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlid\fR, + \fBstatic prgregset_t\fR \fIgregset\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lgetfpregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlid\fR, + \fBprfpregset_t *\fR\fIfpregs\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lsetfpregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlid\fR, + \fBstatic prfpregset_t *\fR\fIfpregs\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lgetxregsize\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlid\fR, + \fBint *\fR\fIxregsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lgetxregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlid\fR, + \fBcaddr_t\fR \fIxregset\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lsetxregs\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlid\fR, + \fBcaddr_t\fR \fIxregset\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +\fBps_lgetregs()\fR, \fBps_lsetregs()\fR, \fBps_lgetfpregs()\fR, +\fBps_lsetfpregs()\fR, \fBps_lgetxregsize()\fR, \fBps_lgetxregs()\fR, +\fBps_lsetxregs()\fR read and write register sets from lightweight processes +(\fBLWP\fRs) within the target process identified by \fIph\fR. +\fBps_lgetregs()\fR gets the general registers of the \fBLWP\fR identified by +\fIlid\fR, and \fBps_lsetregs()\fR sets them. \fBps_lgetfpregs()\fR gets the +\fBLWP\fR's floating point register set, while \fBps_lsetfpregs()\fR sets it. +.SS "SPARC Only" +.sp +.LP +\fBps_lgetxregsize()\fR,\fBps_lgetxregs()\fR, and\fBps_lsetxregs()\fR are +SPARC-specific. They do not need to be defined by a controlling process on +non-SPARC architecture. \fBps_lgetxregsize()\fR returns in +\fB*\fR\fIxregsize\fR the size of the architecture-dependent extra state +registers. \fBps_lgetxregs()\fR gets the extra state registers, and +\fBps_lsetxregs()\fR sets them. +.SH RETURN VALUES +.sp +.ne 2 +.mk +.na +\fB\fBPS_OK\fR \fR +.ad +.RS 16n +.rt +The call returned successfully. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_NOFPREGS\fR \fR +.ad +.RS 16n +.rt +Floating point registers are neither available for this architecture nor for +this process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_NOXREGS\fR \fR +.ad +.RS 16n +.rt +Extra state registers are not available on this architecture. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_ERR\fR \fR +.ad +.RS 16n +.rt +The function did not return successfully. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for description of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +MT LevelSafe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlibc_db\fR(3LIB), \fBproc_service\fR(3PROC), \fBattributes\fR(5), +\fBthreads\fR(5) diff --git a/usr/src/man/man3proc/ps_pglobal_lookup.3proc b/usr/src/man/man3proc/ps_pglobal_lookup.3proc new file mode 100644 index 0000000000..ecd9a9bdc4 --- /dev/null +++ b/usr/src/man/man3proc/ps_pglobal_lookup.3proc @@ -0,0 +1,96 @@ +'\" te +.\" Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved +.\" 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. +.\" 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. +.\" 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] +.TH ps_pglobal_lookup 3PROC "16 Jan 1998" "SunOS 5.11" "Process Control Library Functions" +.SH NAME +ps_pglobal_lookup, ps_pglobal_sym \- look up a symbol in the symbol table of +the load object in the target process +.SH SYNOPSIS +.LP +.nf +#include <proc_service.h> + +\fBps_err_e\fR \fBps_pglobal_lookup\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBconst char *\fR\fIobject_name\fR, \fBconst char *\fR\fIsym_name\fR, + \fBpsaddr_t *\fR\fIsym_addr\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pglobal_sym\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBconst char *\fR\fIobject_name\fR, \fBconst char *\fR\fIsym_name\fR, + \fBps_sym_t *\fR\fIsym\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +\fBps_pglobal_lookup()\fR looks up the symbol \fIsym_name\fR in the symbol +table of the load object \fIobject_name\fR in the target process identified by +\fIph\fR. It returns the symbol's value as an address in the target process in +\fB*\fR\fIsym_addr.\fR +.sp +.LP +\fBps_pglobal_sym()\fR looks up the symbol \fIsym_name\fR in the symbol table +of the load object \fIobject_name\fR in the target process identified by +\fIph\fR. It returns the symbol table entry in \fB*\fR\fIsym.\fR The value in +the symbol table entry is the symbol's value as an address in the target +process. +.SH RETURN VALUES +.sp +.ne 2 +.mk +.na +\fB\fBPS_OK\fR \fR +.ad +.RS 13n +.rt +The call completed successfully. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_NOSYM\fR \fR +.ad +.RS 13n +.rt +The specified symbol was not found. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_ERR\fR \fR +.ad +.RS 13n +.rt +The function did not return successfully. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for description of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +MT LevelSafe +.TE + +.SH SEE ALSO +.sp +.LP +\fBkill\fR(2), \fBlibc_db\fR(3LIB), \fBproc_service\fR(3PROC), +\fBattributes\fR(5), \fBthreads\fR(5) diff --git a/usr/src/man/man3proc/ps_pread.3proc b/usr/src/man/man3proc/ps_pread.3proc new file mode 100644 index 0000000000..80d39b3d3b --- /dev/null +++ b/usr/src/man/man3proc/ps_pread.3proc @@ -0,0 +1,122 @@ +'\" te +.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. +.\" 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. +.\" 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. +.\" 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] +.TH ps_pread 3PROC "12 Oct 2007" "SunOS 5.11" "Process Control Library Functions" +.SH NAME +ps_pread, ps_pwrite, ps_pdread, ps_pdwrite, ps_ptread, ps_ptwrite \- interfaces +in libthread_db that target process memory access +.SH SYNOPSIS +.LP +.nf +#include <proc_service.h> + +\fBps_err_e\fR \fBps_pread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pdread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pdwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_ptread\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_ptwrite\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBpsaddr_t\fR \fIaddr\fR, + \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +These routines copy data between the target process's address space and the +controlling process. \fBps_pread()\fR copies \fIsize\fR bytes from address +\fIaddr\fR in the target process into \fIbuf\fR in the controlling process. +\fBpr_pwrite()\fR is like \fBps_pread()\fR except that the direction of the +copy is reversed; data is copied from the controlling process to the target +process. +.sp +.LP +\fBps_pdread()\fR and \fBps_ptread()\fR behave identically to \fBps_pread()\fR. +\fBps_pdwrite()\fR and \fBps_ptwrite()\fR behave identically to +\fBps_pwrite()\fR. These functions can be implemented as simple aliases for the +corresponding primary functions. They are artifacts of history that must be +maintained. +.SH RETURN VALUES +.sp +.ne 2 +.mk +.na +\fB\fBPS_OK\fR\fR +.ad +.RS 14n +.rt +The call returned successfully. \fIsize\fR bytes were copied. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_BADADDR\fR\fR +.ad +.RS 14n +.rt +Some part of the address range from \fIaddr\fR through +\fIaddr\fR+\fIsize\fR\(mi\fB1\fR is not part of the target process's address +space. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_ERR\fR\fR +.ad +.RS 14n +.rt +The function did not return successfully. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for description of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +MT LevelSafe +.TE + +.SH SEE ALSO +.sp +.LP +\fBlibc_db\fR(3LIB), \fBlibrtld_db\fR(3LIB), \fBproc_service\fR(3PROC), +\fBrtld_db\fR(3EXT), \fBattributes\fR(5), \fBthreads\fR(5) diff --git a/usr/src/man/man3proc/ps_pstop.3proc b/usr/src/man/man3proc/ps_pstop.3proc new file mode 100644 index 0000000000..5c49bd0d35 --- /dev/null +++ b/usr/src/man/man3proc/ps_pstop.3proc @@ -0,0 +1,142 @@ +'\" te +.\" Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved +.\" 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. +.\" 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. +.\" 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] +.TH ps_pstop 3PROC "22 Mar 2001" "SunOS 5.11" "Process Control Library Functions" +.SH NAME +ps_pstop, ps_pcontinue, ps_lstop, ps_lcontinue, ps_lrolltoaddr, ps_kill \- +process and LWP control in libthread_db +.SH SYNOPSIS +.LP +.nf +#include <proc_service.h> + +\fBps_err_e\fR \fBps_pstop\fR(\fBstruct ps_prochandle *\fR\fIph\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_pcontinue\fR(\fBstruct ps_prochandle *\fR\fIph\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lstop\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBlwpid_t\fR \fIlwpid\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lcontinue\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBlwpid_t\fR \fIlwpid\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_lrolltoaddr\fR(\fBstruct ps_prochandle *\fR\fIph\fR, + \fBlwpid_t\fR \fIlwpid\fR, \fBpsaddr_t\fR \fIgo_addr\fR, \fBpsaddr_t\fR \fIstop_addr\fR); +.fi + +.LP +.nf +\fBps_err_e\fR \fBps_kill\fR(\fBstruct ps_prochandle *\fR\fIph\fR, \fBint\fR \fIsignum\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +\fBThe ps_pstop()\fR function stops the target process identified by \fIph\fR, +while the \fBps_pcontinue()\fR function allows it to resume. +.sp +.LP +The \fBlibthread_db()\fR function uses \fBps_pstop()\fR to freeze the target +process while it is under inspection. Within the scope of any single call from +outside \fBlibthread_db\fR to a \fBlibthread_db\fR routine, \fBlibthread_db\fR +will call \fBps_pstop()\fR, at most once. If it does, it will call +\fBps_pcontinue()\fR within the scope of the same routine. +.sp +.LP +The controlling process may already have stopped the target process when it +calls \fBlibthread_db\fR. In that case, it is not obligated to resume the +target process when \fBlibthread_db\fR calls \fBps_pcontinue()\fR. In other +words, \fBps_pstop()\fR is mandatory, while \fBps_pcontinue()\fR is advisory. +After \fBps_pstop()\fR, the target process must be stopped; after +\fBps_pcontinue()\fR, the target process may be running. +.sp +.LP +The \fBps_lstop()\fR and \fBps_lcontinue()\fR functions stop and resume a +single lightweight process (\fBLWP\fR) within the target process \fIph\fR. +.sp +.LP +The \fBps_lrolltoaddr()\fR function is used to roll an \fBLWP\fR forward out of +a critical section when the process is stopped. It is also used to run the +\fBlibthread_db\fR agent thread on behalf of \fBlibthread\fR. The +\fBps_lrolltoaddr()\fR function is always called with the target process +stopped, that is, there has been a preceding call to \fBps_pstop()\fR. The +specified \fBLWP\fR must be continued at the address \fIgo_addr\fR, or at its +current address if \fIgo_addr\fR is \fINULL\fR. It should then be stopped when +its execution reaches \fIstop_addr\fR. This routine does not return until the +\fBLWP\fR has stopped at \fIstop_addr\fR. +.sp +.LP +The \fBps_kill()\fR function directs the signal \fIsignum\fR to the target +process for which the handle is \fIph\fR. It has the same semantics as +\fBkill\fR(2). +.SH RETURN VALUES +.sp +.ne 2 +.mk +.na +\fB\fBPS_OK\fR \fR +.ad +.RS 14n +.rt +The call completed successfully. In the case of \fBps_pstop()\fR, the target +process is stopped. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_BADLID\fR \fR +.ad +.RS 14n +.rt +For \fBps_lstop()\fR, \fBps_lcontinue()\fR and \fBps_lrolltoaddr()\fR; there is +no \fBLWP\fR with id \fIlwipd\fR in the target process. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBPS_ERR\fR \fR +.ad +.RS 14n +.rt +The function did not return successfully. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for description of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +MT LevelSafe +.TE + +.SH SEE ALSO +.sp +.LP +\fBkill\fR(2), \fBlibc_db\fR(3LIB), \fBproc_service\fR(3PROC), +\fBattributes\fR(5), \fBthreads\fR(5) |