Add some more ulps.
[glibc/pb-stable.git] / linuxthreads_db / thread_dbP.h
blob13e534afe635c86eebc94d03511506a2b640d29e
1 /* Private header for thread debug library. */
2 #ifndef _THREAD_DBP_H
3 #define _THREAD_DBP_H 1
5 #include <string.h>
6 #include "proc_service.h"
7 #include "thread_db.h"
8 #include "../linuxthreads/internals.h"
11 /* Comment out the following for less verbose output. */
12 #ifndef NDEBUG
13 # define LOG(c) if (__td_debug) __libc_write (2, c "\n", strlen (c "\n"))
14 extern int __td_debug;
15 #else
16 # define LOG(c)
17 #endif
20 /* Handle for a process. This type is opaque. */
21 struct td_thragent
23 /* Delivered by the debugger and we have to pass it back in the
24 proc callbacks. */
25 struct ps_prochandle *ph;
27 /* Some cached information. */
29 /* Address of the `__pthread_handles' array. */
30 struct pthread_handle_struct *handles;
32 /* Address of the `pthread_kyes' array. */
33 struct pthread_key_struct *keys;
35 /* Maximum number of threads. */
36 int pthread_threads_max;
38 /* Maximum number of thread-local data keys. */
39 int pthread_keys_max;
41 /* Size of 2nd level array for thread-local data keys. */
42 int pthread_key_2ndlevel_size;
44 /* Sizeof struct _pthread_descr_struct. */
45 int sizeof_descr;
47 /* Pointer to the `__pthread_threads_events' variable in the target. */
48 psaddr_t pthread_threads_eventsp;
50 /* Pointer to the `__pthread_last_event' variable in the target. */
51 psaddr_t pthread_last_event;
53 /* Pointer to the `__pthread_handles_num' variable. */
54 psaddr_t pthread_handles_num;
58 /* Type used internally to keep track of thread agent descriptors. */
59 struct agent_list
61 td_thragent_t *ta;
62 struct agent_list *next;
65 /* List of all known descriptors. */
66 extern struct agent_list *__td_agent_list;
68 /* Function used to test for correct thread agent pointer. */
69 static inline int
70 ta_ok (const td_thragent_t *ta)
72 struct agent_list *runp = __td_agent_list;
74 if (ta == NULL)
75 return 0;
77 while (runp != NULL && runp->ta != ta)
78 runp = runp->next;
80 return runp != NULL;
83 #endif /* thread_dbP.h */