1td_thr_get_info(3C_DB)Threads Debugging Library Functionstd_thr_get_info(3C_DB)
2
3
4
6 td_thr_get_info - get thread information in libc_db library of inter‐
7 faces
8
10 cc [ flag... ] file... -lc_db [ library... ]
11 #include <proc_service.h>
12 #include <thread_db.h>
13
14 td_err_e td_thr_get_info(const td_thrhandle_t *th_p, td_thrinfo_t *ti_p);
15
16
18 The td_thr_get_info() function fills in the td_thrinfo_t structure
19 *ti_p with values for the thread identified by th_p.
20
21
22 The td_thrinfo_t structure contains the following fields:
23
24 typedef struct td_thrinfo_t {
25 td_thragen_tx *ti_ta_p /* internal process handle */
26 unsigned ti_user_flags; /* value of flags parameter */
27 thread_t ti_tid; /* thread identifier */
28 char *ti_tls; /* pointer to thread-local storage*/
29 paddr ti_startfunc; /* address of function at which thread
30 execution began*/
31 paddr ti_stkbase; /* base of thread's stack area*/
32 int ti_stksize; /* size in bytes of thread's allocated
33 stack region*/
34 paddr ti_ro_area; /* address of ulwp_t structure*/
35 int ti_ro_size /* size of the ulwp_t structure in
36 bytes */
37 td_thr_state_e ti_state /* state of the thread */
38 uchar_t ti_db_suspended /* non-zero if thread suspended by
39 td_thr_dbsuspend*/
40 td_thr_type_e ti_type /* type of the thread*/
41 int ti_pc /* value of thread's program counter*/
42 int ti_sp /* value of thread's stack counter*/
43 short ti_flags /* set of special flags used by
44 libc*/
45 int ti_pri /* priority of thread returned by
46 thr_getprio(3T)*/
47 lwpid_t ti_lid /* id of light weight process (LWP)
48 executing this thread*/
49 sigset_t ti_sigmask /* thread's signal mask. See
50 thr_sigsetmask(3T)*/
51 u_char ti_traceme /* non-zero if event tracing is on*/
52 u_char_t ti_preemptflag /* non-zero if thread preempted when
53 last active*/
54 u_char_t ti_pirecflag /* non-zero if thread runs priority
55 beside regular */
56 sigset_t ti_pending /* set of signals pending for this
57 thread*/
58 td_thr_events_t ti_events /* bitmap of events enabled for this
59 thread*/
60 } ;
61
62
63
64 The ti_ta_p member is the internal process handle identifying the
65 process of which the thread is a member.
66
67
68 The ti_user_flags member is the value of the flags parameter passed to
69 thr_create(3C) when the thread was created.
70
71
72 The ti_tid member is the thread identifier for the thread returned by
73 thr_create(3C).
74
75
76 The ti_tls member is the thread's pointer to thread-local storage.
77
78
79 The ti_startfunc member is the address of the function at which thread
80 execution began, as specified when the thread was created with thr_cre‐
81 ate(3C).
82
83
84 The ti_stkbase member is the base of the thread's stack area.
85
86
87 The ti_stksize member is the size in bytes of the thread's allocated
88 stack region.
89
90
91 The ti_ro_area member is the address of the ulwp_t structure for this
92 thread. Since accessing the ulwp_t structure directly violates the
93 encapsulation provided by libc_db, this member should generally not be
94 used. However, it might be useful as a prototype for extensions.
95
96
97 The ti_state member is the state of the thread. The td_thr_state_e
98 enumeration type can contain the following values:
99
100 TD_THR_ANY_STATE This value is never returned by
101 td_thr_get_info() but is used as a wildcard
102 to select threads in td_ta_thr_iter().
103
104
105 TD_THR_UNKNOWN The libc_db library cannot determine the
106 state of the thread.
107
108
109 TD_THR_STOPPED The thread has been stopped by a call to
110 thr_suspend(3C).
111
112
113 TD_THR_RUN The thread is runnable, but it is not cur‐
114 rently assigned to an LWP.
115
116
117 TD_THR_ACTIVE The thread is currently executing on an LWP.
118
119
120 TD_THR_ZOMBIE The thread has exited, but it has not yet
121 been deallocated by a call to thr_join(3C).
122
123
124 TD_THR_SLEEP The thread is not currently runnable.
125
126
127 TD_THR_STOPPED_ASLEEP The thread is both blocked by TD_THR_SLEEP
128 and stopped by a call to td_thr_dbsus‐
129 pend(3C_DB).
130
131
132
133 The ti_db_suspended member is non-zero if and only if this thread is
134 currently suspended because the controlling process has called
135 td_thr_dbsuspend on it.
136
137
138 The ti_type member is a type of thread. It is either TD_THR_USER for a
139 user thread (one created by the application), or TD_THR_SYSTEM for one
140 created by libc.
141
142
143 The ti_pc member is the value of the thread's program counter, provided
144 that the thread's ti_state value is TD_THR_SLEEP, TD_THR_STOPPED, or
145 TD_THR_STOPPED_ASLEEP. Otherwise, the value of this member is unde‐
146 fined.
147
148
149 The ti_sp member is the value of the thread's stack pointer, provided
150 that the thread's ti_state value is TD_THR_SLEEP, TD_THR_STOPPED, or
151 TD_THR_STOPPED_ASLEEP. Otherwise, the value of this member is unde‐
152 fined.
153
154
155 The ti_flags member is a set of special flags used by libc, currently
156 of use only to those debugging libc.
157
158
159 The ti_pri member is the thread's priority as it would be returned by
160 thr_getprio(3C).
161
162
163 The ti_lid member is the ID of the LWP executing this thread, or the ID
164 of the LWP that last executed this thread, if this thread is not cur‐
165 rently assigned to anLWP.
166
167
168 The ti_sigmask member is this thread's signal mask. See thr_sigset‐
169 mask(3C).
170
171
172 The ti_traceme member is non-zero if and only if event tracing for this
173 thread is on.
174
175
176 The ti_preemptflag member is non-zero if and only if the thread was
177 preempted the last time it was active.
178
179
180 The ti_pirecflag member is non-zero if and only if due to priority
181 inheritance the thread is currently running at a priority other than
182 its regular priority.
183
184
185 The ti_events member is the bitmap of events enabled for this thread.
186
188 TD_OK The call completed successfully.
189
190
191 TD_BADTH An invalid thread handle was passed in.
192
193
194 TD_DBERR A call to one of the imported interface routines failed.
195
196
197 TD_ERR The call did not complete successfully.
198
199
201 See attributes(5) for description of the following attributes:
202
203
204
205
206 ┌─────────────────────────────┬─────────────────────────────┐
207 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
208 ├─────────────────────────────┼─────────────────────────────┤
209 │MT-Level │Safe │
210 └─────────────────────────────┴─────────────────────────────┘
211
213 libc_db(3LIB), td_ta_thr_iter(3C_DB), td_thr_dbsuspend(3C_DB), thr_cre‐
214 ate(3C), thr_getprio(3C), thr_join(3C), thr_sigsetmask(3C), thr_sus‐
215 pend(3C), attributes(5), threads(5)
216
217
218
219SunOS 5.11 20 Oct 1998 td_thr_get_info(3C_DB)