summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads_db
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
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')
-rw-r--r--libpthread/linuxthreads_db/ChangeLog208
-rw-r--r--libpthread/linuxthreads_db/Makefile68
-rw-r--r--libpthread/linuxthreads_db/Versions15
-rw-r--r--libpthread/linuxthreads_db/proc_service.h70
-rw-r--r--libpthread/linuxthreads_db/td_init.c32
-rw-r--r--libpthread/linuxthreads_db/td_log.c32
-rw-r--r--libpthread/linuxthreads_db/td_ta_clear_event.c53
-rw-r--r--libpthread/linuxthreads_db/td_ta_delete.c58
-rw-r--r--libpthread/linuxthreads_db/td_ta_enable_stats.c35
-rw-r--r--libpthread/linuxthreads_db/td_ta_event_addr.c75
-rw-r--r--libpthread/linuxthreads_db/td_ta_event_getmsg.c128
-rw-r--r--libpthread/linuxthreads_db/td_ta_get_nthreads.c44
-rw-r--r--libpthread/linuxthreads_db/td_ta_get_ph.c36
-rw-r--r--libpthread/linuxthreads_db/td_ta_get_stats.c35
-rw-r--r--libpthread/linuxthreads_db/td_ta_map_id2thr.c63
-rw-r--r--libpthread/linuxthreads_db/td_ta_map_lwp2thr.c81
-rw-r--r--libpthread/linuxthreads_db/td_ta_new.c154
-rw-r--r--libpthread/linuxthreads_db/td_ta_reset_stats.c35
-rw-r--r--libpthread/linuxthreads_db/td_ta_set_event.c53
-rw-r--r--libpthread/linuxthreads_db/td_ta_setconcurrency.c35
-rw-r--r--libpthread/linuxthreads_db/td_ta_thr_iter.c143
-rw-r--r--libpthread/linuxthreads_db/td_ta_tsd_iter.c56
-rw-r--r--libpthread/linuxthreads_db/td_thr_clear_event.c57
-rw-r--r--libpthread/linuxthreads_db/td_thr_dbresume.c30
-rw-r--r--libpthread/linuxthreads_db/td_thr_dbsuspend.c30
-rw-r--r--libpthread/linuxthreads_db/td_thr_event_enable.c41
-rw-r--r--libpthread/linuxthreads_db/td_thr_event_getmsg.c60
-rw-r--r--libpthread/linuxthreads_db/td_thr_get_info.c75
-rw-r--r--libpthread/linuxthreads_db/td_thr_getfpregs.c44
-rw-r--r--libpthread/linuxthreads_db/td_thr_getgregs.c44
-rw-r--r--libpthread/linuxthreads_db/td_thr_getxregs.c30
-rw-r--r--libpthread/linuxthreads_db/td_thr_getxregsize.c30
-rw-r--r--libpthread/linuxthreads_db/td_thr_set_event.c57
-rw-r--r--libpthread/linuxthreads_db/td_thr_setfpregs.c42
-rw-r--r--libpthread/linuxthreads_db/td_thr_setgregs.c42
-rw-r--r--libpthread/linuxthreads_db/td_thr_setprio.c30
-rw-r--r--libpthread/linuxthreads_db/td_thr_setsigpending.c31
-rw-r--r--libpthread/linuxthreads_db/td_thr_setxregs.c30
-rw-r--r--libpthread/linuxthreads_db/td_thr_sigsetmask.c30
-rw-r--r--libpthread/linuxthreads_db/td_thr_tsd.c76
-rw-r--r--libpthread/linuxthreads_db/td_thr_validate.c51
-rw-r--r--libpthread/linuxthreads_db/thread_db.h436
-rw-r--r--libpthread/linuxthreads_db/thread_dbP.h83
43 files changed, 2858 insertions, 0 deletions
diff --git a/libpthread/linuxthreads_db/ChangeLog b/libpthread/linuxthreads_db/ChangeLog
new file mode 100644
index 000000000..4d29ae0bb
--- /dev/null
+++ b/libpthread/linuxthreads_db/ChangeLog
@@ -0,0 +1,208 @@
+2000-01-19 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_thr_getgregs.c: Correct size parameter of memset call.
+
+1999-12-02 Ulrich Drepper <drepper@cygnus.com>
+
+ * proc_service.h: Fix typoes in last added declaractions.
+
+1999-12-01 Ulrich Drepper <drepper@cygnus.com>
+
+ * proc_service.h: Add ps_pstop, ps_pcontinue, ps_lstop, and
+ ps_lcontinue prototypes.
+
+1999-11-23 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile: Correct dependency for shared object.
+
+1999-11-22 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_ta_map_lwp2thr.c: Add missing brace in comparison.
+
+ * thread_dbP.h (LOG): Only print message if __td_debug is nonzero.
+ * td_init.c: Add __td_debug.
+
+1999-11-12 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_ta_thr_iter.c: Start copying list of descriptors from right
+ position in target process.
+
+ * td_ta_thr_iter.c: Fix loop starting point over all but main and
+ manager thread.
+
+ * td_ta_thr_iter.c: Read descriptors for main and manager thread
+ special since after this we can assume that no new threads will be
+ created anymore (at least in the gdb implementation).
+
+ * Makefile: Define version correctly.
+
+1999-11-10 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_ta_map_lwp2thr.c: If p_pid field is zero, this is before the
+ thread library is initialized and we get the PID from the
+ debugger.
+
+1999-11-08 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_thr_get_info.c: Make sure ti_lid is never zero.
+
+ * proc_service.h: Add ps_getpid prototype.
+
+1999-11-03 Ulrich Drepper <drepper@cygnus.com>
+
+ * thread_dbP.h (ta_ok): New function.
+ * td_ta_new.c: Add new handle to list.
+ * td_ta_delete.c: Remove handle from list.
+ * td_ta_clear_event.c: Use ta_ok to check for correct ta parameter.
+ * td_ta_enable_stats.c: Likewise.
+ * td_ta_event_addr.c: Likewise.
+ * td_ta_event_getmsg.c: Likewise.
+ * td_ta_get_nthreads.c: Likewise.
+ * td_ta_get_ph.c: Likewise.
+ * td_ta_get_stats.c: Likewise.
+ * td_ta_map_id2thr.c: Likewise.
+ * td_ta_map_lwp2thr.c: Likewise.
+ * td_ta_reset_stats.c: Likewise.
+ * td_ta_set_event.c: Likewise.
+ * td_ta_setconcurrency.c: Likewise.
+ * td_ta_thr_iter.c: Likewise.
+
+ * td_ta_tsd_iter.c: Optimize memory retrieving.
+
+ * Versions: New file.
+
+ * td_thr_get_info.c (td_thr_get_info): Initialize ti_traceme.
+
+1999-11-02 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_ta_thr_iter.c (td_ta_thr_iter): Optimize a bit. Read all
+ handles at once.
+
+ * thread_dbP.h (struct th_thragent): Add pthread_handle_num.
+ * td_ta_new.c: Initialize pthread_handle_num.
+ * td_ta_event_getmsg.c: If last event was already reported search
+ for another unreported event.
+
+ * td_thr_get_info.c (td_thr_get_info): Initialize ti_events.
+
+ * Makefile (libthread_db-routines): Add td_ta_set_event,
+ td_ta_event_getmsg, and td_ta_clear_event.
+ * td_ta_clear_event.c: New file.
+ * td_ta_event_getmsg.c: New file.
+ * td_ta_new.c: Get address of __pthread_last_event in target.
+ * td_ta_set_event.c: Don't overwrite old mask, set additional bits.
+ * td_thr_set_event.c: Likewise.
+ * td_thr_clear_event.c: Implement.
+ * thread_db.h: Declare td_ta_clear_event and td_ta_event_getmsg.
+ * thread_dbP.h (struct td_thragent): Add pthread_last_event.
+
+ * td_ta_new.c: Don't test for __pthread_threads_debug. Get address
+ of __pthread_threads_events and fail if this is not possible.
+ * td_ta_event_addr.c: Implement.
+ * td_thr_event_enable.c: Implement.
+ * td_thr_event_getmsg.c: Implement.
+ * td_thr_set_event.c: Implement.
+ * td_ta_set_event.c: New file.
+ * thread_db.h (td_eventbuf_t): Define.
+ Declare td_ta_set_event.
+ * thread_dbP.h (struct td_thragent): Add pthread_threads_eventsp.
+
+ * td_thr_getfpregs.c: For terminated threads return empty structure.
+ * td_thr_getgregs.c: Likewise.
+ * td_thr_setfpregs.c: Likewise.
+ * td_thr_setgregs.c: Likewise.
+
+1999-11-01 Ulrich Drepper <drepper@cygnus.com>
+
+ * thread_db.h: Shuffle types around to make things work for gdb.
+ * thread_dbP.h: Include proc_service.h before thread_db.h.
+
+ * thread_db.h: It's TD_NOLIBTHREAD, not TD_LIBTHREAD.
+ * td_ta_new.c: Likewise.
+
+1999-10-14 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_ta_new.c: p_startfct does not exist anymore.
+
+ * td_thr_get_info.c: Always initialize start function.
+
+ * td_ta_thr_iter.c: Don't return threads which exited (but are not
+ joined).
+
+ * td_thr_validate.c: Don't skip manager thread.
+
+1999-10-13 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_ta_thr_iter.c: Use size of descriptor from *TA.
+ Don't return manager thread before it's actually running.
+ Actually use state parameter to distingusih at least a few states.
+
+ * td_thr_get_info.c: Handle manager thread special. Fill in ti_lid,
+ ti_state, and ti_startfunc fields.
+
+1999-10-12 Andreas Jaeger <aj@suse.de>
+
+ * thread_dbP.h: Include <string.h> for strlen declaration. Remove
+ __libc_write prototype since this is already declared in
+ linuxthreads/internals.h.
+
+1999-10-11 Ulrich Drepper <drepper@cygnus.com>
+
+ * thread_db.h: Fix comment for ti_type.
+
+ * td_thr_get_info.c: Initialize ti_type field.
+
+ * td_ta_thr_iter.c: Also report the manager thread.
+
+1999-10-08 Andreas Jaeger <aj@suse.de>
+
+ * thread_db.h: Fix typos in comments.
+
+ * td_ta_get_nthreads.c (td_ta_get_nthreads): Don't hardcode
+ libpthread library name, get it from <gnu/lib-names.h> instead.
+ * td_ta_new.c (td_ta_new): Likewise.
+
+1999-10-08 Ulrich Drepper <drepper@cygnus.com>
+
+ * shlib-versions: New file.
+
+1999-10-07 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile: New file.
+ * proc_service.h: New file.
+ * td_init.c: New file.
+ * td_log.c: New file.
+ * td_ta_delete.c: New file.
+ * td_ta_enable_stats.c: New file.
+ * td_ta_event_addr.c: New file.
+ * td_ta_get_nthreads.c: New file.
+ * td_ta_get_ph.c: New file.
+ * td_ta_get_stats.c: New file.
+ * td_ta_map_id2thr.c: New file.
+ * td_ta_map_lwp2thr.c: New file.
+ * td_ta_new.c: New file.
+ * td_ta_reset_stats.c: New file.
+ * td_ta_setconcurrency.c: New file.
+ * td_ta_thr_iter.c: New file.
+ * td_ta_tsd_iter.c: New file.
+ * td_thr_clear_event.c: New file.
+ * td_thr_dbresume.c: New file.
+ * td_thr_dbsuspend.c: New file.
+ * td_thr_event_enable.c: New file.
+ * td_thr_event_getmsg.c: New file.
+ * td_thr_get_info.c: New file.
+ * td_thr_getfpregs.c: New file.
+ * td_thr_getgregs.c: New file.
+ * td_thr_getxregs.c: New file.
+ * td_thr_getxregsize.c: New file.
+ * td_thr_set_event.c: New file.
+ * td_thr_setfpregs.c: New file.
+ * td_thr_setgregs.c: New file.
+ * td_thr_setprio.c: New file.
+ * td_thr_setsigpending.c: New file.
+ * td_thr_setxregs.c: New file.
+ * td_thr_sigsetmask.c: New file.
+ * td_thr_tsd.c: New file.
+ * td_thr_validate.c: New file.
+ * thread_db.h: New file.
+ * thread_dbP.h: New file.
diff --git a/libpthread/linuxthreads_db/Makefile b/libpthread/linuxthreads_db/Makefile
new file mode 100644
index 000000000..eea12c7a4
--- /dev/null
+++ b/libpthread/linuxthreads_db/Makefile
@@ -0,0 +1,68 @@
+# Makefile for uClibc's pthread library
+#
+# Copyright (C) 2002 Erik Andersen <andersen@uclibc.org>
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Makefile for uClibc
+
+TOPDIR=../../
+include $(TOPDIR)Rules.mak
+
+#Adjust the soname version to avoid namespace collisions with glibc's libpthread
+PT_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
+LIBPTHREAD=../libpthread.a
+
+# set up system dependencies include dirs (NOTE: order matters!)
+PTDIR = $(TOPDIR)libpthread/linuxthreads/
+SYSDEPINC = -I$(PTDIR)sysdeps/unix/sysv/linux \
+ -I$(PTDIR)sysdeps/pthread \
+ -I$(PTDIR)sysdeps/unix/sysv \
+ -I$(PTDIR)sysdeps/unix/unix \
+ -I$(PTDIR)sysdeps/$(TARGET_ARCH) \
+ -I$(PTDIR)sysdeps \
+ -I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH)
+CFLAGS += $(SYSDEPINC) -DLIBPTHREAD_SO="\"libpthread.so.$(PT_VERSION)\"" -D_GNU_SOURCE
+
+CSRC=td_init.c td_log.c td_ta_clear_event.c td_ta_delete.c \
+ td_ta_enable_stats.c td_ta_event_addr.c td_ta_event_getmsg.c \
+ td_ta_get_nthreads.c td_ta_get_ph.c td_ta_get_stats.c \
+ td_ta_map_id2thr.c td_ta_map_lwp2thr.c td_ta_new.c td_ta_reset_stats.c \
+ td_ta_set_event.c td_ta_setconcurrency.c td_ta_thr_iter.c \
+ td_ta_tsd_iter.c td_thr_clear_event.c td_thr_dbresume.c \
+ td_thr_dbsuspend.c td_thr_event_enable.c td_thr_event_getmsg.c \
+ td_thr_get_info.c td_thr_getfpregs.c td_thr_getgregs.c \
+ td_thr_getxregs.c td_thr_getxregsize.c td_thr_set_event.c \
+ td_thr_setfpregs.c td_thr_setgregs.c td_thr_setprio.c \
+ td_thr_setsigpending.c td_thr_setxregs.c td_thr_sigsetmask.c \
+ td_thr_tsd.c td_thr_validate.c
+COBJS=$(patsubst %.c,%.o, $(CSRC))
+OBJS=$(COBJS)
+
+all: $(OBJS) $(LIBPTHREAD)
+
+$(LIBPTHREAD): ar-target
+
+ar-target: $(OBJS)
+ $(AR) $(ARFLAGS) $(LIBPTHREAD) $(OBJS)
+
+$(COBJS): %.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+clean:
+ rm -f *.[oa] *~ core
+
+
+
diff --git a/libpthread/linuxthreads_db/Versions b/libpthread/linuxthreads_db/Versions
new file mode 100644
index 000000000..83b30ee6e
--- /dev/null
+++ b/libpthread/linuxthreads_db/Versions
@@ -0,0 +1,15 @@
+libthread_db {
+ GLIBC_2.1.3 {
+ # t*
+ td_init; td_log; td_ta_clear_event; td_ta_delete; td_ta_enable_stats;
+ td_ta_event_addr; td_ta_event_getmsg; td_ta_get_nthreads; td_ta_get_ph;
+ td_ta_get_stats; td_ta_map_id2thr; td_ta_map_lwp2thr; td_ta_new;
+ td_ta_reset_stats; td_ta_set_event; td_ta_setconcurrency;
+ td_ta_thr_iter; td_ta_tsd_iter; td_thr_clear_event; td_thr_dbresume;
+ td_thr_dbsuspend; td_thr_event_enable; td_thr_event_getmsg;
+ td_thr_get_info; td_thr_getfpregs; td_thr_getgregs; td_thr_getxregs;
+ td_thr_getxregsize; td_thr_set_event; td_thr_setfpregs; td_thr_setgregs;
+ td_thr_setprio; td_thr_setsigpending; td_thr_setxregs; td_thr_sigsetmask;
+ td_thr_tsd; td_thr_validate;
+ }
+}
diff --git a/libpthread/linuxthreads_db/proc_service.h b/libpthread/linuxthreads_db/proc_service.h
new file mode 100644
index 000000000..8f9a7d98f
--- /dev/null
+++ b/libpthread/linuxthreads_db/proc_service.h
@@ -0,0 +1,70 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* The definitions in this file must correspond to those in the debugger. */
+#include <sys/procfs.h>
+
+typedef enum
+{
+ PS_OK, /* generic "call succeeded" */
+ PS_ERR, /* generic. */
+ PS_BADPID, /* bad process handle */
+ PS_BADLID, /* bad lwp identifier */
+ PS_BADADDR, /* bad address */
+ PS_NOSYM, /* p_lookup() could not find given symbol */
+ PS_NOFREGS
+ /*
+ * FPU register set not available for given
+ * lwp
+ */
+} ps_err_e;
+
+
+struct ps_prochandle; /* user defined. */
+
+
+extern ps_err_e ps_pdread(struct ps_prochandle *,
+ psaddr_t, void *, size_t);
+extern ps_err_e ps_pdwrite(struct ps_prochandle *,
+ psaddr_t, const void *, size_t);
+extern ps_err_e ps_ptread(struct ps_prochandle *,
+ psaddr_t, void *, size_t);
+extern ps_err_e ps_ptwrite(struct ps_prochandle *,
+ psaddr_t, const void *, size_t);
+
+extern ps_err_e ps_pglobal_lookup(struct ps_prochandle *,
+ const char *object_name, const char *sym_name, psaddr_t *sym_addr);
+
+
+extern ps_err_e ps_lgetregs(struct ps_prochandle *,
+ lwpid_t, prgregset_t);
+extern ps_err_e ps_lsetregs(struct ps_prochandle *,
+ lwpid_t, const prgregset_t);
+extern ps_err_e ps_lgetfpregs(struct ps_prochandle *,
+ lwpid_t, prfpregset_t *);
+extern ps_err_e ps_lsetfpregs(struct ps_prochandle *,
+ lwpid_t, const prfpregset_t *);
+
+extern pid_t ps_getpid (struct ps_prochandle *);
+
+
+extern ps_err_e ps_pstop (const struct ps_prochandle *);
+extern ps_err_e ps_pcontinue (const struct ps_prochandle *);
+
+extern ps_err_e ps_lstop (const struct ps_prochandle *, lwpid_t);
+extern ps_err_e ps_lcontinue (const struct ps_prochandle *, lwpid_t);
diff --git a/libpthread/linuxthreads_db/td_init.c b/libpthread/linuxthreads_db/td_init.c
new file mode 100644
index 000000000..683aec427
--- /dev/null
+++ b/libpthread/linuxthreads_db/td_init.c
@@ -0,0 +1,32 @@
+/* Initialization function of thread debugger support library.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "thread_dbP.h"
+
+int __td_debug;
+
+
+td_err_e
+td_init (void)
+{
+ /* XXX We have to figure out what has to be done. */
+ LOG (__FUNCTION__);
+ return TD_OK;
+}
diff --git a/libpthread/linuxthreads_db/td_log.c b/libpthread/linuxthreads_db/td_log.c
new file mode 100644
index 000000000..0c4a3670f
--- /dev/null
+++ b/libpthread/linuxthreads_db/td_log.c
@@ -0,0 +1,32 @@
+/* Noop, left for historical reasons.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "thread_dbP.h"
+
+
+td_err_e
+td_log (void)
+{
+ /* This interface is deprecated in the Sun interface. We provide it
+ for compatibility but don't do anyhting ourself. We might in
+ future do some logging if this seems reasonable. */
+ LOG (__FUNCTION__);
+ return TD_OK;
+}
diff --git a/libpthread/linuxthreads_db/td_ta_clear_event.c b/libpthread/linuxthreads_db/td_ta_clear_event.c
new file mode 100644
index 000000000..02d83360f
--- /dev/null
+++ b/libpthread/linuxthreads_db/td_ta_clear_event.c
@@ -0,0 +1,53 @@
+/* Globally disable events.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "thread_dbP.h"
+
+
+td_err_e
+td_ta_clear_event (ta, event)
+ const td_thragent_t *ta;
+ td_thr_events_t *event;
+{
+ td_thr_events_t old_event;
+ int i;
+
+ LOG (__FUNCTION__);
+
+ /* Test whether the TA parameter is ok. */
+ if (! ta_ok (ta))
+ return TD_BADTA;
+
+ /* Write the new value into the thread data structure. */
+ if (ps_pdread (ta->ph, ta->pthread_threads_eventsp,
+ &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+ return TD_ERR; /* XXX Other error value? */
+
+ /* Remove the set bits in. */
+ for (i = 0; i < TD_EVENTSIZE; ++i)
+ old_event.event_bits[i] &= ~event->event_bits[i];
+
+ /* Write the new value into the thread data structure. */
+ if (ps_pdwrite (ta->ph, ta->pthread_threads_eventsp,
+ &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+ return TD_ERR; /* XXX Other error value? */
+
+ return TD_OK;
+}
diff --git a/libpthread/linuxthreads_db/td_ta_delete.c b/libpthread/linuxthreads_db/td_ta_delete.c
new file mode 100644
index 000000000..e98357766
--- /dev/null
+++ b/libpthread/linuxthreads_db/td_ta_delete.c
@@ -0,0 +1,58 @@
+/* Detach to target process.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <stdlib.h>
+
+#include "thread_dbP.h"
+
+
+td_err_e
+td_ta_delete (td_thragent_t *ta)
+{
+ LOG (__FUNCTION__);
+
+ /* Safety check. */
+ if (ta == NULL || __td_agent_list == NULL)
+ return TD_BADTA;
+
+ /* Remove the handle from the list. */
+ if (ta == __td_agent_list->ta)
+ /* It's the first element of the list. */
+ __td_agent_list = __td_agent_list->next;
+ else
+ {
+ /* We have to search for it. */
+ struct agent_list *runp = __td_agent_list;
+
+ while (runp->next != NULL && runp->next->ta != ta)
+ runp = runp->next;
+
+ if (runp->next == NULL)
+ /* It's not a valid decriptor since it is not in the list. */
+ return TD_BADTA;
+
+ runp->next = runp->next->next;
+ }
+
+ /* The handle was allocated in `td_ta_new'. */
+ free (ta);
+
+ return TD_OK;
+}
diff --git a/libpthread/linuxthreads_db/td_ta_enable_stats.c b/libpthread/linuxthreads_db/td_ta_enable_stats.c
new file mode 100644
index 000000000..abf4d200a
--- /dev/null
+++ b/libpthread/linuxthreads_db/td_ta_enable_stats.c
@@ -0,0 +1,35 @@
+/* Enable collection of statistics for process.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "thread_dbP.h"
+
+
+td_err_e
+td_ta_enable_stats (const td_thragent_t *ta, int enable)
+{
+ /* XXX We have to figure out what has to be done. */
+ LOG (__FUNCTION__);
+
+ /* Test whether the TA parameter is ok. */
+ if (! ta_ok (ta))
+ return TD_BADTA;
+
+ return TD_OK;
+}
diff --git a/libpthread/linuxthreads_db/td_ta_event_addr.c b/libpthread/linuxthreads_db/td_ta_event_addr.c
new file mode 100644
index 000000000..e610e4422
--- /dev/null
+++ b/libpthread/linuxthreads_db/td_ta_event_addr.c
@@ -0,0 +1,75 @@
+/* Get event address.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+//#include <gnu/lib-names.h>
+
+#include "thread_dbP.h"
+
+
+td_err_e
+td_ta_event_addr (const td_thragent_t *ta, td_event_e event, td_notify_t *addr)
+{
+ td_err_e res = TD_NOEVENT;