Go to main content

man pages section 3: Extended Library Functions, Volume 3

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

Plwp_setfpregs (3PROC)

Name

Pgetareg, Pputareg, Lgetareg, Lputareg, Plwp_getregs, Plwp_getfpregs, Plwp_getxregs, Plwp_setregs, Plwp_setfpregs, Plwp_setxregs, Plwp_getasrs, Plwp_setasrs, Plwp_getgwindows - retrieve or modify machine registers in a victim process

Synopsis

#include <libproc.h>
int Pgetareg(ps_prochandle_t *Pr, int regno, prgreg_t *preg);
int Pputareg(ps_prochandle_t *Pr, int regno, prgreg_t reg);
int Lgetareg(ps_lwphandle_t *Lwp, int regno, prgreg_t *preg);
int Lputareg(ps_lwphandle_t *Lwp, int regno, prgreg_t reg);
int Plwp_getregs(ps_prochandle_t *Pr, lwpid_t lwpid,
         prgregset_t gregs);
int Plwp_getfpregs(ps_prochandle_t *Pr, lwpid_t lwpid,
         prfpregset_t *fpregs);
int Plwp_getxregs(ps_prochandle_t *Pr, lwpid_t lwpid,
         prxregset_t *xregs);
int Plwp_setregs(ps_prochandle_t *Pr, lwpid_t lwpid,
         const prgregset_t gregs);
int Plwp_setfpregs(ps_prochandle_t *Pr, lwpid_t lwpid,
         const prfpregset_t *fpregs);
int Plwp_setxregs(ps_prochandle_t *Pr, lwpid_t lwpid,
         const prxregset_t *xregs);
int Plwp_getasrs(ps_prochandle_t *P, lwpid_t lwpid,
         asrset_t asrs);
int Plwp_setasrs(ps_prochandle_t *P, lwpid_t lwpid,
         const asrset_t asrs);
int Plwp_getgwindows(ps_prochandle_t *P, lwpid_t lwpid,
         gwindows_t *gwins);

Description

The Pr argument identifies a victim process attached to the controlling process by the create and grab interfaces. For more information, see the Pcreate(3PROC) and Pgrab(3PROC) man pages. The Lwp argument identifies a specific lwp attached to the controlling process of the victim process, by the Lgrab() interface, and the lwpid argument identifies one of the lwps in the victim process, not necessarily attached to the controlling process by the Lgrab() interface. For more information, see the Lgrab(3PROC) man page.

The Pgetareg() and Lgetareg() functions retrieve the value of one machine register from the representative lwp of the victim process in case of the Pgetareg() function or from the specific lwp in case of the Lgetareg() function.

The Pputareg() and Lputareg() functions set the value of one machine register in the representative lwp of the victim process in case of the Pputareg() function or in the specific lwp in case of the Lputareg() function.

The Plwp_getregs(), Plwp_getfpregs(), and Plwp_getxregs() functions retrieve, respectively, the general register set, the floating-point register set, and the extended register set from the lwp identified by the lwpid argument of the victim process.

The Plwp_setregs(), Plwp_setfpregs(), and Plwp_setxregs() functions modify, respectively, the general register set, the floating-point register set, and the extended register set in the lwp identified by the lwpid argument of the victim process.

The sparc-only functions, Plwp_getasrs() and Plwp_setasrs() functions retrieve and modify the asr register set in the lwp identified by the lwpid argument of the victim process.

The sparc-only function, Plwp_getgwindows() retrieves the register windows that are not flushed to the stack when the victim process or lwp is stopped.

Return Values

On successful completion, all of these functions return 0. On error, they return -1 and set errno to indicate the error.

Errors

On failure, these errno values may be set:

EAGAIN

Process has been lost to control, needs the Preopen() function

EBUSY

Process is not stopped

EINTR

Signal received while waiting for stop

EINVAL

Invalid register number

ENODATA

The requested register set is empty

ENOENT

The victim process has terminated

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
Unsafe

See Also

libproc.h(3HEAD), libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), proc(5)