SunOS man pages : td_thr_setfpregs (3)
Threads Library Functions td_thr_getgregs(3THR)
NAME
td_thr_getgregs, td_thr_setgregs, td_thr_getfpregs,
td_thr_setfpregs, td_thr_getxregsize, td_thr_getxregs,
td_thr_setxregs - reading and writing thread registers in
libthread_db
SYNOPSIS
cc [ flag ... ] file ... -lthread_db [ library ... ]
#include <proc_service.h>
#include <thread_db.h>
td_err_e td_thr_getgregs(const td_thrhandle_t *th_p,
prgregset_tgregset);
td_err_e td_thr_setgregs(const td_thrhandle_t *th_p,
prgregset_tgregset);
td_err_e td_thr_getfpregs(const td_thrhandle_t *th_p,
prfpregset_t *fpregset);
td_err_e td_thr_setfpregs(const td_thrhandle_t *th_p,
prfpregset_t *fpregset);
td_err_e td_thr_getxregsize(const td_thrhandle_t *th_p, int
*xregsize);
td_err_e td_thr_getxregs(const td_thrhandle_t *th_p,
prxregset_t *xregset);
td_err_e td_thr_setxregs(const td_thrhandle_t *th_p,
prxregset_t *xregset);
DESCRIPTION
These routines read and write the register sets associated
with thread th_p. td_thr_getgregs() and td_thr_setgregs()
get and set, respectively, the general registers of thread
th_p. td_thr_getfpregs() and td_thr_setfpregs() get and set,
respectively, the thread's floating point register set.
td_thr_getxregsize(), td_thr_getxregs(), and
td_thr_setxregs() are SPARC-specific. td_thr_getxregsize()
returns in *xregsize the size of the architecture-dependent
extra state registers. td_thr_getxregs() and
td_thr_setxregs() get and set, respectively, those extra
state registers. On non-SPARC architectures, these routines
return TD_NOXREGS.
If thread th_p is currently executing on a lightweight pro-
cess ( LWP), these routines will read or write, respec-
tively, the appropriate register set to the LWP using the
imported interface. If the thread is not currently execut-
ing on a LWP, then the floating point and extra state
SunOS 5.8 Last change: 20 Oct 1998 1
Threads Library Functions td_thr_getgregs(3THR)
registers may not be read or written. Some of the general
registers may also not be readable or writable, depending on
the architecture. In this case, td_thr_getfpregs() and
td_thr_setfpregs() will return TD_NOFPREGS, and
td_thr_getxregs() and td_thr_setxregs() will return
TD_NOXREGS. Calls to td_thr_getgregs() and
td_thr_setgregs() will succeed, but values returned for
unreadable registers will be undefined, and values specified
for unwritable registers will be ignored. In this instance,
a value of TD_PARTIALREGS will be returned. See the
architecture-specific notes that follow regarding the regis-
ters that may be read and written for a thread not currently
executing on a LWP.
SPARC
On a thread not currently assigned to a LWP, only %i0-%i7,
%l0-%l7, %g7, %pc, and %sp (%o6) may be read or written.
%pc and %sp refer to the program counter and stack pointer
that the thread will have when it resumes execution.
Intel IA
On a thread not currently assigned to a LWP, only %pc, %sp,
%ebp, %edi, %edi, and %ebx may be read.
RETURN VALUES
TD_OK The call completed successfully.
TD_BADTH
An invalid thread handle was passed in.
TD_DBERR
A call to one of the imported interface routines
failed.
TD_PARTIALREGS
Because the thread is not currently assigned to a LWP,
not all registers were read or written. See DESCRIP-
TION for a discussion about which registers are not
saved when a thread is not assigned to an LWP.
TD_NOFPREGS
Floating point registers could not be read or written,
either because the thread is not currently assigned to
an LWP, or because the architecture does not have
such registers.
TD_NOXREGS
Architecture-dependent extra state registers could not
be read or written, either because the thread is not
currently assigned to an LWP, or because the archi-
tecture does not have such registers, or because the
architecture is not a SPARC architecture.
SunOS 5.8 Last change: 20 Oct 1998 2
Threads Library Functions td_thr_getgregs(3THR)
TD_ERR
A libthread_db internal error occurred.
ATTRIBUTES
See attributes(5) for description of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| MT-Level | Safe |
|_____________________________|_____________________________|
SEE ALSO
libthread_db(3THR), libthread_db(3LIB), attributes(5)
SunOS 5.8 Last change: 20 Oct 1998 3
|
 |
|
|