|
Threads Library Functions | td_thr_getgregs(3THR) |
| 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); |
|
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 process ( LWP), these routines will read or write, respectively, the appropriate
register set to the LWP using the imported interface. If the thread is not currently executing on a LWP, then the floating point and
extra state 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 registers 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.
|
|
|
-
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 DESCRIPTION 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 architecture does not have such registers, or because the architecture is not a SPARC architecture.
-
TD_ERR
- A libthread_db internal error occurred.
|
|
See attributes(5) for description of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT-Level | Safe |
|
| |