TD_THR_GETGREGS(3C_DB) Threads Debugging Library Functions TD_THR_GETGREGS(3C_DB)

td_thr_getgregs, td_thr_setgregs, td_thr_getfpregs, td_thr_setfpregs, td_thr_getxregsize, td_thr_getxregs, td_thr_setxregsreading and writing thread registers in libc_db

Threads Debugging Library (libc_db, -lc_db)

#include <proc_service.h>
#include <thread_db.h>

td_err_e
td_thr_getgregs(const td_thrhandle_t *th_p, prgregset_t gregset);

td_err_e
td_thr_setgregs(const td_thrhandle_t *th_p, prgregset_t gregset);

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 functions read and write the register sets associated with thread th_p. The () and () functions get and set, respectively, the general registers of thread th_p. The () and () functions get and set, respectively, the thread's floating point register set.

The () function returns in *xregsize the size of the architecture-dependent extra state registers. The () and () functions get and set, respectively, those extra state registers. The buffer passed to td_thr_getxregs() must be at least the size indicated by td_thr_getxregsize(). This size must not be assumed and may change between processes. Failure to do so, will result in the system overwriting memory. Not all platforms implement extended registers. When they are not implemented, these functions return TD_NOXREGS.

The td_thr_getgregs(), td_thr_setgregs(), td_thr_getfpregs(), td_thr_setfpregs(), td_thr_getxregsize(), td_thr_getxregs(), and td_thr_setxregs() functions return one of the following values:

The call completed successfully.
An invalid thread handle was passed in.
A call to one of the imported interface routines failed.
Floating point registers could not be read or written because the architecture does not have such registers.
Architecture-dependent extra state registers could not be read or written, because the architecture does not have such registers.
A internal error occurred.

libc_db(3LIB), attributes(7)

January 23, 2023 OmniOS