1td_thr_getgregs(3C_DB)Threads Debugging Library Functionstd_thr_getgregs(3C_DB)
2
3
4
6 td_thr_getgregs, td_thr_setgregs, td_thr_getfpregs, td_thr_setfpregs,
7 td_thr_getxregsize, td_thr_getxregs, td_thr_setxregs - reading and
8 writing thread registers in libc_db
9
11 cc [ flag... ] file... -lc_db [ library... ]
12 #include <proc_service.h>
13 #include <thread_db.h>
14
15 td_err_e td_thr_getgregs(const td_thrhandle_t *th_p, prgregset_tgregset);
16
17
18 td_err_e td_thr_setgregs(const td_thrhandle_t *th_p, prgregset_tgregset);
19
20
21 td_err_e td_thr_getfpregs(const td_thrhandle_t *th_p, prfpregset_t *fpregset);
22
23
24 td_err_e td_thr_setfpregs(const td_thrhandle_t *th_p, prfpregset_t *fpregset);
25
26
27 td_err_e td_thr_getxregsize(const td_thrhandle_t *th_p, int *xregsize);
28
29
30 td_err_e td_thr_getxregs(const td_thrhandle_t *th_p, prxregset_t *xregset);
31
32
33 td_err_e td_thr_setxregs(const td_thrhandle_t *th_p, prxregset_t *xregset);
34
35
37 These functions read and write the register sets associated with thread
38 th_p. The td_thr_getgregs() and td_thr_setgregs() functions get and
39 set, respectively, the general registers of thread th_p. The
40 td_thr_getfpregs() and td_thr_setfpregs() functions get and set,
41 respectively, the thread's floating point register set. The
42 td_thr_getxregsize(), td_thr_getxregs(), and td_thr_setxregs() func‐
43 tions are SPARC-specific. The td_thr_getxregsize() function returns in
44 *xregsize the size of the architecture-dependent extra state registers.
45 The td_thr_getxregs() and td_thr_setxregs() functions get and set,
46 respectively, those extra state registers. On non-SPARC architectures,
47 these functions return TD_NOXREGS.
48
49
50 If the thread specified by th_p is currently executing on a lightweight
51 process ( LWP), these functions read or write, respectively, the appro‐
52 priate register set to the LWP using the imported interface. If the
53 thread is not currently executing on an LWP, the floating point and
54 extra state registers may cannot be read or written. Some of the gen‐
55 eral registers might also not be readable or writable, depending on the
56 architecture, in which case td_thr_getfpregs() and td_thr_setfpregs()
57 return TD_NOFPREGS and td_thr_getxregs() and td_thr_setxregs() will
58 TD_NOXREGS. Calls to td_thr_getgregs() and td_thr_setgregs() succeed,
59 but values returned for unreadable registers are undefined, values
60 specified for unwritable registers are ignored. In this instance, and
61 TD_PARTIALREGS is returned. See the architecture-specific notes that
62 follow regarding the registers that may be read and written for a
63 thread not currently executing on an LWP.
64
65 SPARC
66 On a thread not currently assigned to an LWP, only %i0-%i7, %l0-%l7,
67 %g7, %pc, and %sp (%o6) can be read or written. %pc and %sp refer to
68 the program counter and stack pointer that the thread will have when it
69 resumes execution.
70
71 x86 Architecture
72 On a thread not currently assigned to an LWP, only %pc, %sp, %ebp,
73 %edi, %edi, and %ebx can be read.
74
76 TD_OK The call completed successfully.
77
78
79 TD_BADTH An invalid thread handle was passed in.
80
81
82 TD_DBERR A call to one of the imported interface routines
83 failed.
84
85
86 TD_PARTIALREGS Because the thread is not currently assigned to a
87 LWP, not all registers were read or written. See
88 DESCRIPTION for a discussion about which registers
89 are not saved when a thread is not assigned to an
90 LWP.
91
92
93 TD_NOFPREGS Floating point registers could not be read or writ‐
94 ten, either because the thread is not currently
95 assigned to an LWP, or because the architecture does
96 not have such registers.
97
98
99 TD_NOXREGS Architecture-dependent extra state registers could
100 not be read or written, either because the thread is
101 not currently assigned to an LWP, or because the
102 architecture does not have such registers, or because
103 the architecture is not a SPARC architecture.
104
105
106 TD_ERR A libc_db internal error occurred.
107
108
110 See attributes(5) for description of the following attributes:
111
112
113
114
115 ┌─────────────────────────────┬─────────────────────────────┐
116 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
117 ├─────────────────────────────┼─────────────────────────────┤
118 │MT-Level │Safe │
119 └─────────────────────────────┴─────────────────────────────┘
120
122 libc_db(3LIB), attributes(5)
123
124
125
126SunOS 5.11 20 Oct 1998 td_thr_getgregs(3C_DB)