summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads_db/thread_dbP.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-20 09:18:50 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-20 09:18:50 +0000
commite356ea321c8098cf1a83a67e27d64c44de08a298 (patch)
tree8be9273fb8f0e6acab47a9e09552cfbea5400b31 /libpthread/linuxthreads_db/thread_dbP.h
parent07ebf927b17572d92e785533d6e8ac1668cc57c6 (diff)
Merge in the pthread library. This is the linuxthreads library taken from
glibc 2.1.3 and ported to work with uClibc by Stefan Soucek and Erik Andersen (me). Stefan has hacked things up such that linuxthreads runs on MMU-less systems (tested only on arm-nommu). Erik cleaned things up and made it work properly as a shared library. -Erik
Diffstat (limited to 'libpthread/linuxthreads_db/thread_dbP.h')
-rw-r--r--libpthread/linuxthreads_db/thread_dbP.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/libpthread/linuxthreads_db/thread_dbP.h b/libpthread/linuxthreads_db/thread_dbP.h
new file mode 100644
index 000000000..13e534afe
--- /dev/null
+++ b/libpthread/linuxthreads_db/thread_dbP.h
@@ -0,0 +1,83 @@
+/* Private header for thread debug library. */
+#ifndef _THREAD_DBP_H
+#define _THREAD_DBP_H 1
+
+#include <string.h>
+#include "proc_service.h"
+#include "thread_db.h"
+#include "../linuxthreads/internals.h"
+
+
+/* Comment out the following for less verbose output. */
+#ifndef NDEBUG
+# define LOG(c) if (__td_debug) __libc_write (2, c "\n", strlen (c "\n"))
+extern int __td_debug;
+#else
+# define LOG(c)
+#endif
+
+
+/* Handle for a process. This type is opaque. */
+struct td_thragent
+{
+ /* Delivered by the debugger and we have to pass it back in the
+ proc callbacks. */
+ struct ps_prochandle *ph;
+
+ /* Some cached information. */
+
+ /* Address of the `__pthread_handles' array. */
+ struct pthread_handle_struct *handles;
+
+ /* Address of the `pthread_kyes' array. */
+ struct pthread_key_struct *keys;
+
+ /* Maximum number of threads. */
+ int pthread_threads_max;
+
+ /* Maximum number of thread-local data keys. */
+ int pthread_keys_max;
+
+ /* Size of 2nd level array for thread-local data keys. */
+ int pthread_key_2ndlevel_size;
+
+ /* Sizeof struct _pthread_descr_struct. */
+ int sizeof_descr;
+
+ /* Pointer to the `__pthread_threads_events' variable in the target. */
+ psaddr_t pthread_threads_eventsp;
+
+ /* Pointer to the `__pthread_last_event' variable in the target. */
+ psaddr_t pthread_last_event;
+
+ /* Pointer to the `__pthread_handles_num' variable. */
+ psaddr_t pthread_handles_num;
+};
+
+
+/* Type used internally to keep track of thread agent descriptors. */
+struct agent_list
+{
+ td_thragent_t *ta;
+ struct agent_list *next;
+};
+
+/* List of all known descriptors. */
+extern struct agent_list *__td_agent_list;
+
+/* Function used to test for correct thread agent pointer. */
+static inline int
+ta_ok (const td_thragent_t *ta)
+{
+ struct agent_list *runp = __td_agent_list;
+
+ if (ta == NULL)
+ return 0;
+
+ while (runp != NULL && runp->ta != ta)
+ runp = runp->next;
+
+ return runp != NULL;
+}
+
+#endif /* thread_dbP.h */