1 /* Private header for thread debug library. */
3 #define _THREAD_DBP_H 1
6 #include "proc_service.h"
8 #include "../linuxthreads/internals.h"
11 /* Indeces for the symbol names. */
14 PTHREAD_THREADS_EVENTS
= 0,
19 LINUXTHREADS_PTHREAD_THREADS_MAX
,
20 LINUXTHREADS_PTHREAD_KEYS_MAX
,
21 LINUXTHREADS_PTHREAD_SIZEOF_DESCR
,
22 LINUXTHREADS_CREATE_EVENT
,
23 LINUXTHREADS_DEATH_EVENT
,
24 LINUXTHREADS_REAP_EVENT
,
29 /* Comment out the following for less verbose output. */
31 # define LOG(c) if (__td_debug) __libc_write (2, c "\n", strlen (c "\n"))
32 extern int __td_debug
;
38 /* Handle for a process. This type is opaque. */
41 /* Delivered by the debugger and we have to pass it back in the
43 struct ps_prochandle
*ph
;
45 /* Some cached information. */
47 /* Address of the `__pthread_handles' array. */
48 struct pthread_handle_struct
*handles
;
50 /* Address of the `pthread_kyes' array. */
51 struct pthread_key_struct
*keys
;
53 /* Maximum number of threads. */
54 int pthread_threads_max
;
56 /* Maximum number of thread-local data keys. */
59 /* Size of 2nd level array for thread-local data keys. */
60 int pthread_key_2ndlevel_size
;
62 /* Sizeof struct _pthread_descr_struct. */
65 /* Pointer to the `__pthread_threads_events' variable in the target. */
66 psaddr_t pthread_threads_eventsp
;
68 /* Pointer to the `__pthread_last_event' variable in the target. */
69 psaddr_t pthread_last_event
;
71 /* Pointer to the `__pthread_handles_num' variable. */
72 psaddr_t pthread_handles_num
;
76 /* Type used internally to keep track of thread agent descriptors. */
80 struct agent_list
*next
;
83 /* List of all known descriptors. */
84 extern struct agent_list
*__td_agent_list
;
86 /* Function used to test for correct thread agent pointer. */
88 ta_ok (const td_thragent_t
*ta
)
90 struct agent_list
*runp
= __td_agent_list
;
95 while (runp
!= NULL
&& runp
->ta
!= ta
)
102 /* Internal wrapper around ps_pglobal_lookup. */
103 extern int td_lookup (struct ps_prochandle
*ps
, int idx
, psaddr_t
*sym_addr
);
105 #endif /* thread_dbP.h */