From a9f5aa1cc96fc2c71f19a9c3e9dcbee0e78f83ca Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 15 Nov 2005 03:13:04 +0000 Subject: rename current stable linuxthreads to linuxthreads.old to prepare for import of latest glibc version --- libpthread/linuxthreads_db/Banner | 1 - libpthread/linuxthreads_db/Makefile | 15 - libpthread/linuxthreads_db/Makefile.in | 43 --- libpthread/linuxthreads_db/Versions | 21 - libpthread/linuxthreads_db/proc_service.h | 70 ---- libpthread/linuxthreads_db/td_init.c | 32 -- libpthread/linuxthreads_db/td_log.c | 32 -- libpthread/linuxthreads_db/td_symbol_list.c | 56 --- libpthread/linuxthreads_db/td_ta_clear_event.c | 53 --- libpthread/linuxthreads_db/td_ta_delete.c | 58 --- libpthread/linuxthreads_db/td_ta_enable_stats.c | 35 -- libpthread/linuxthreads_db/td_ta_event_addr.c | 73 ---- libpthread/linuxthreads_db/td_ta_event_getmsg.c | 129 ------- libpthread/linuxthreads_db/td_ta_get_nthreads.c | 42 -- libpthread/linuxthreads_db/td_ta_get_ph.c | 36 -- libpthread/linuxthreads_db/td_ta_get_stats.c | 35 -- libpthread/linuxthreads_db/td_ta_map_id2thr.c | 79 ---- libpthread/linuxthreads_db/td_ta_map_lwp2thr.c | 91 ----- libpthread/linuxthreads_db/td_ta_new.c | 150 ------- libpthread/linuxthreads_db/td_ta_reset_stats.c | 35 -- libpthread/linuxthreads_db/td_ta_set_event.c | 53 --- libpthread/linuxthreads_db/td_ta_setconcurrency.c | 35 -- libpthread/linuxthreads_db/td_ta_thr_iter.c | 174 --------- libpthread/linuxthreads_db/td_ta_tsd_iter.c | 56 --- libpthread/linuxthreads_db/td_thr_clear_event.c | 62 --- libpthread/linuxthreads_db/td_thr_dbresume.c | 30 -- libpthread/linuxthreads_db/td_thr_dbsuspend.c | 30 -- libpthread/linuxthreads_db/td_thr_event_enable.c | 57 --- libpthread/linuxthreads_db/td_thr_event_getmsg.c | 65 ---- libpthread/linuxthreads_db/td_thr_get_info.c | 83 ---- libpthread/linuxthreads_db/td_thr_getfpregs.c | 58 --- libpthread/linuxthreads_db/td_thr_getgregs.c | 58 --- libpthread/linuxthreads_db/td_thr_getxregs.c | 30 -- libpthread/linuxthreads_db/td_thr_getxregsize.c | 30 -- libpthread/linuxthreads_db/td_thr_set_event.c | 62 --- libpthread/linuxthreads_db/td_thr_setfpregs.c | 47 --- libpthread/linuxthreads_db/td_thr_setgregs.c | 47 --- libpthread/linuxthreads_db/td_thr_setprio.c | 30 -- libpthread/linuxthreads_db/td_thr_setsigpending.c | 31 -- libpthread/linuxthreads_db/td_thr_setxregs.c | 30 -- libpthread/linuxthreads_db/td_thr_sigsetmask.c | 30 -- libpthread/linuxthreads_db/td_thr_tls_get_addr.c | 70 ---- libpthread/linuxthreads_db/td_thr_tsd.c | 82 ---- libpthread/linuxthreads_db/td_thr_validate.c | 70 ---- libpthread/linuxthreads_db/thread_db.h | 451 ---------------------- libpthread/linuxthreads_db/thread_dbP.h | 110 ------ 46 files changed, 2967 deletions(-) delete mode 100644 libpthread/linuxthreads_db/Banner delete mode 100644 libpthread/linuxthreads_db/Makefile delete mode 100644 libpthread/linuxthreads_db/Makefile.in delete mode 100644 libpthread/linuxthreads_db/Versions delete mode 100644 libpthread/linuxthreads_db/proc_service.h delete mode 100644 libpthread/linuxthreads_db/td_init.c delete mode 100644 libpthread/linuxthreads_db/td_log.c delete mode 100644 libpthread/linuxthreads_db/td_symbol_list.c delete mode 100644 libpthread/linuxthreads_db/td_ta_clear_event.c delete mode 100644 libpthread/linuxthreads_db/td_ta_delete.c delete mode 100644 libpthread/linuxthreads_db/td_ta_enable_stats.c delete mode 100644 libpthread/linuxthreads_db/td_ta_event_addr.c delete mode 100644 libpthread/linuxthreads_db/td_ta_event_getmsg.c delete mode 100644 libpthread/linuxthreads_db/td_ta_get_nthreads.c delete mode 100644 libpthread/linuxthreads_db/td_ta_get_ph.c delete mode 100644 libpthread/linuxthreads_db/td_ta_get_stats.c delete mode 100644 libpthread/linuxthreads_db/td_ta_map_id2thr.c delete mode 100644 libpthread/linuxthreads_db/td_ta_map_lwp2thr.c delete mode 100644 libpthread/linuxthreads_db/td_ta_new.c delete mode 100644 libpthread/linuxthreads_db/td_ta_reset_stats.c delete mode 100644 libpthread/linuxthreads_db/td_ta_set_event.c delete mode 100644 libpthread/linuxthreads_db/td_ta_setconcurrency.c delete mode 100644 libpthread/linuxthreads_db/td_ta_thr_iter.c delete mode 100644 libpthread/linuxthreads_db/td_ta_tsd_iter.c delete mode 100644 libpthread/linuxthreads_db/td_thr_clear_event.c delete mode 100644 libpthread/linuxthreads_db/td_thr_dbresume.c delete mode 100644 libpthread/linuxthreads_db/td_thr_dbsuspend.c delete mode 100644 libpthread/linuxthreads_db/td_thr_event_enable.c delete mode 100644 libpthread/linuxthreads_db/td_thr_event_getmsg.c delete mode 100644 libpthread/linuxthreads_db/td_thr_get_info.c delete mode 100644 libpthread/linuxthreads_db/td_thr_getfpregs.c delete mode 100644 libpthread/linuxthreads_db/td_thr_getgregs.c delete mode 100644 libpthread/linuxthreads_db/td_thr_getxregs.c delete mode 100644 libpthread/linuxthreads_db/td_thr_getxregsize.c delete mode 100644 libpthread/linuxthreads_db/td_thr_set_event.c delete mode 100644 libpthread/linuxthreads_db/td_thr_setfpregs.c delete mode 100644 libpthread/linuxthreads_db/td_thr_setgregs.c delete mode 100644 libpthread/linuxthreads_db/td_thr_setprio.c delete mode 100644 libpthread/linuxthreads_db/td_thr_setsigpending.c delete mode 100644 libpthread/linuxthreads_db/td_thr_setxregs.c delete mode 100644 libpthread/linuxthreads_db/td_thr_sigsetmask.c delete mode 100644 libpthread/linuxthreads_db/td_thr_tls_get_addr.c delete mode 100644 libpthread/linuxthreads_db/td_thr_tsd.c delete mode 100644 libpthread/linuxthreads_db/td_thr_validate.c delete mode 100644 libpthread/linuxthreads_db/thread_db.h delete mode 100644 libpthread/linuxthreads_db/thread_dbP.h (limited to 'libpthread/linuxthreads_db') diff --git a/libpthread/linuxthreads_db/Banner b/libpthread/linuxthreads_db/Banner deleted file mode 100644 index 6f4f3f818..000000000 --- a/libpthread/linuxthreads_db/Banner +++ /dev/null @@ -1 +0,0 @@ -libthread_db work sponsored by Alpha Processor Inc diff --git a/libpthread/linuxthreads_db/Makefile b/libpthread/linuxthreads_db/Makefile deleted file mode 100644 index f92f205a5..000000000 --- a/libpthread/linuxthreads_db/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# Makefile for uClibc -# -# Copyright (C) 2000-2005 Erik Andersen -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -TOPDIR=../../ - -top_srcdir=$(TOPDIR) -top_builddir=../../ -include $(top_builddir)Rules.mak -all: libs -include Makefile.in -include $(top_srcdir)Makerules diff --git a/libpthread/linuxthreads_db/Makefile.in b/libpthread/linuxthreads_db/Makefile.in deleted file mode 100644 index a066edd0e..000000000 --- a/libpthread/linuxthreads_db/Makefile.in +++ /dev/null @@ -1,43 +0,0 @@ -# Makefile for uClibc -# -# Copyright (C) 2000-2005 Erik Andersen -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -#CFLAGS+=$(SSP_ALL_CFLAGS) - -PT_MAJOR_VERSION:=$(MAJOR_VERSION) -# Get the thread include dependencies and shared object name -CFLAGS+=-DLIBPTHREAD_SO="\"libpthread.so.$(PT_MAJOR_VERSION)\"" - -# Remove any -z defs since this lib will have undefined symbols -LDFLAGS:=$(subst -z defs,,$(LDFLAGS)) --warn-unresolved-symbols - -ifeq ($(PTHREADS_DEBUG_SUPPORT),y) -STRIP_FLAGS:=-X --strip-debug -R .note -R .comment -endif - -DOMULTI=n - -LIB_NAME:=libthread_db -libthread_db_FULL_NAME:=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so - -MAJOR_VERSION:=1 - -libthread_db_DIR:=$(top_srcdir)libpthread/linuxthreads_db -libthread_db_OUT:=$(top_builddir)libpthread/linuxthreads_db - -libthread_db_SRC:=$(wildcard $(libthread_db_DIR)/*.c) - -libthread_db_OBJ:=$(patsubst $(libthread_db_DIR)/%.c,$(libthread_db_OUT)/%.o,$(libthread_db_SRC)) - -libthread_db-a-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_OBJ) -libthread_db-so-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_OBJ:.o=.os) - -libthread_db-multi-$(PTHREADS_DEBUG_SUPPORT)+=$(libthread_db_SRC) - -objclean-y+=libthread_db_clean - -lib-a-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/libthread_db.a -lib-so-$(PTHREADS_DEBUG_SUPPORT)+=$(top_builddir)lib/libthread_db.so diff --git a/libpthread/linuxthreads_db/Versions b/libpthread/linuxthreads_db/Versions deleted file mode 100644 index 4ca8042c1..000000000 --- a/libpthread/linuxthreads_db/Versions +++ /dev/null @@ -1,21 +0,0 @@ -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; - } - GLIBC_2.2.3 { - td_symbol_list; - } - GLIBC_2.3 { - td_thr_tls_get_addr; - } -} diff --git a/libpthread/linuxthreads_db/proc_service.h b/libpthread/linuxthreads_db/proc_service.h deleted file mode 100644 index 74136c03e..000000000 --- a/libpthread/linuxthreads_db/proc_service.h +++ /dev/null @@ -1,70 +0,0 @@ -/* 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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 - -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 deleted file mode 100644 index d714f1ba0..000000000 --- a/libpthread/linuxthreads_db/td_init.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Initialization function of thread debugger support library. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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 ("td_init"); - return TD_OK; -} diff --git a/libpthread/linuxthreads_db/td_log.c b/libpthread/linuxthreads_db/td_log.c deleted file mode 100644 index 025273a63..000000000 --- a/libpthread/linuxthreads_db/td_log.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Noop, left for historical reasons. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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 anything ourself. We might in - future do some logging if this seems reasonable. */ - LOG ("td_log"); - return TD_OK; -} diff --git a/libpthread/linuxthreads_db/td_symbol_list.c b/libpthread/linuxthreads_db/td_symbol_list.c deleted file mode 100644 index 779332b9d..000000000 --- a/libpthread/linuxthreads_db/td_symbol_list.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Return list of symbols the library can request. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2001. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include "thread_dbP.h" - - -static const char *symbol_list_arr[] = -{ - [PTHREAD_THREADS_EVENTS] = "__pthread_threads_events", - [PTHREAD_LAST_EVENT] = "__pthread_last_event", - [PTHREAD_HANDLES_NUM] = "__pthread_handles_num", - [PTHREAD_HANDLES] = "__pthread_handles", - [PTHREAD_KEYS] = "pthread_keys", - [LINUXTHREADS_PTHREAD_THREADS_MAX] = "__linuxthreads_pthread_threads_max", - [LINUXTHREADS_PTHREAD_KEYS_MAX] = "__linuxthreads_pthread_keys_max", - [LINUXTHREADS_PTHREAD_SIZEOF_DESCR] = "__linuxthreads_pthread_sizeof_descr", - [LINUXTHREADS_CREATE_EVENT] = "__linuxthreads_create_event", - [LINUXTHREADS_DEATH_EVENT] = "__linuxthreads_death_event", - [LINUXTHREADS_REAP_EVENT] = "__linuxthreads_reap_event", - [LINUXTHREADS_INITIAL_REPORT_EVENTS] = "__linuxthreads_initial_report_events", - [LINUXTHREADS_VERSION] = "__linuxthreads_version", - [NUM_MESSAGES] = NULL -}; - - -const char ** -td_symbol_list (void) -{ - return symbol_list_arr; -} - - -int -td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr) -{ - assert (idx >= 0 && idx < NUM_MESSAGES); - return ps_pglobal_lookup (ps, LIBPTHREAD_SO, symbol_list_arr[idx], sym_addr); -} diff --git a/libpthread/linuxthreads_db/td_ta_clear_event.c b/libpthread/linuxthreads_db/td_ta_clear_event.c deleted file mode 100644 index bdbcf47aa..000000000 --- a/libpthread/linuxthreads_db/td_ta_clear_event.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Globally disable events. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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 ("td_ta_clear_event"); - - /* 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 deleted file mode 100644 index 0e6ec17d0..000000000 --- a/libpthread/linuxthreads_db/td_ta_delete.c +++ /dev/null @@ -1,58 +0,0 @@ -/* Detach to target process. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include - -#include "thread_dbP.h" - - -td_err_e -td_ta_delete (td_thragent_t *ta) -{ - LOG ("td_ta_delete"); - - /* 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 deleted file mode 100644 index 1d4c34a8d..000000000 --- a/libpthread/linuxthreads_db/td_ta_enable_stats.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Enable collection of statistics for process. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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 ("td_ta_enable_stats"); - - /* 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 deleted file mode 100644 index 8bce35ae8..000000000 --- a/libpthread/linuxthreads_db/td_ta_event_addr.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Get event address. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_event_addr (const td_thragent_t *ta, td_event_e event, td_notify_t *addr) -{ - td_err_e res = TD_NOEVENT; - int idx = -1; - - LOG ("td_ta_event_addr"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - switch (event) - { - case TD_CREATE: - idx = LINUXTHREADS_CREATE_EVENT; - break; - - case TD_DEATH: - idx = LINUXTHREADS_DEATH_EVENT; - break; - - case TD_REAP: - idx = LINUXTHREADS_REAP_EVENT; - break; - - default: - /* Event cannot be handled. */ - break; - } - - /* Now get the address. */ - if (idx != -1) - { - psaddr_t taddr; - - if (td_lookup (ta->ph, idx, &taddr) == PS_OK) - { - /* Success, we got the address. */ - addr->type = NOTIFY_BPT; - addr->u.bptaddr = taddr; - - res = TD_OK; - } - else - res = TD_ERR; - } - - return res; -} diff --git a/libpthread/linuxthreads_db/td_ta_event_getmsg.c b/libpthread/linuxthreads_db/td_ta_event_getmsg.c deleted file mode 100644 index ec68ae0e2..000000000 --- a/libpthread/linuxthreads_db/td_ta_event_getmsg.c +++ /dev/null @@ -1,129 +0,0 @@ -/* Retrieve event. - Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include - -#include "thread_dbP.h" -#include "../linuxthreads/internals.h" - - -td_err_e -td_ta_event_getmsg (const td_thragent_t *ta, td_event_msg_t *msg) -{ - /* XXX I cannot think of another way but using a static variable. */ - static td_thrhandle_t th; - td_eventbuf_t event; - psaddr_t addr; - - LOG ("td_ta_event_getmsg"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - /* Get the pointer to the thread descriptor with the last event. */ - if (ps_pdread (ta->ph, ta->pthread_last_event, - &addr, sizeof (void *)) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - /* If the pointer is NULL no event occurred. */ - if (addr == 0) - return TD_NOMSG; - - /* Read the even structure from the target. */ - if (ps_pdread (ta->ph, - ((char *) addr - + offsetof (struct _pthread_descr_struct, p_eventbuf)), - &event, sizeof (td_eventbuf_t)) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - /* Check whether an event occurred. */ - if (event.eventnum == TD_EVENT_NONE) - { - /* Oh well, this means the last event was already read. So - we have to look for any other event. */ - struct pthread_handle_struct handles[ta->pthread_threads_max]; - int num; - int i; - - /* Read the number of currently active threads. */ - if (ps_pdread (ta->ph, ta->pthread_handles_num, &num, sizeof (int)) - != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - /* Now read the handles. */ - if (ps_pdread (ta->ph, ta->handles, handles, - ta->pthread_threads_max * sizeof (handles[0])) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - for (i = 0; i < ta->pthread_threads_max && num > 0; ++i) - { - if (handles[i].h_descr == NULL) - /* No entry here. */ - continue; - - /* First count this active thread. */ - --num; - - if (handles[i].h_descr == addr) - /* We already handled this. */ - continue; - - /* Read the event data for this thread. */ - if (ps_pdread (ta->ph, - ((char *) handles[i].h_descr - + offsetof (struct _pthread_descr_struct, - p_eventbuf)), - &event, sizeof (td_eventbuf_t)) != PS_OK) - return TD_ERR; - - if (event.eventnum != TD_EVENT_NONE) - { - /* We found a thread with an unreported event. */ - addr = handles[i].h_descr; - break; - } - } - - /* If we haven't found any other event signal this to the user. */ - if (event.eventnum == TD_EVENT_NONE) - return TD_NOMSG; - } - - /* Generate the thread descriptor. */ - th.th_ta_p = (td_thragent_t *) ta; - th.th_unique = addr; - - /* Fill the user's data structure. */ - msg->event = event.eventnum; - msg->th_p = &th; - msg->msg.data = (uintptr_t) event.eventdata; - - /* And clear the event message in the target. */ - memset (&event, '\0', sizeof (td_eventbuf_t)); - if (ps_pdwrite (ta->ph, - ((char *) addr - + offsetof (struct _pthread_descr_struct, p_eventbuf)), - &event, sizeof (td_eventbuf_t)) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - return TD_OK; -} diff --git a/libpthread/linuxthreads_db/td_ta_get_nthreads.c b/libpthread/linuxthreads_db/td_ta_get_nthreads.c deleted file mode 100644 index 839b56be5..000000000 --- a/libpthread/linuxthreads_db/td_ta_get_nthreads.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Get the number of threads in the process. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_get_nthreads (const td_thragent_t *ta, int *np) -{ - psaddr_t addr; - - LOG ("td_ta_get_nthreads"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - /* Access the variable `__pthread_handles_num'. */ - if (td_lookup (ta->ph, PTHREAD_HANDLES_NUM, &addr) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - if (ps_pdread (ta->ph, addr, np, sizeof (int)) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - return TD_OK; -} diff --git a/libpthread/linuxthreads_db/td_ta_get_ph.c b/libpthread/linuxthreads_db/td_ta_get_ph.c deleted file mode 100644 index 23d328508..000000000 --- a/libpthread/linuxthreads_db/td_ta_get_ph.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Get external process handle. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_get_ph (const td_thragent_t *ta, struct ps_prochandle **ph) -{ - LOG ("td_ta_get_ph"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - *ph = ta->ph; - - return TD_OK; -} diff --git a/libpthread/linuxthreads_db/td_ta_get_stats.c b/libpthread/linuxthreads_db/td_ta_get_stats.c deleted file mode 100644 index 6bf2f5352..000000000 --- a/libpthread/linuxthreads_db/td_ta_get_stats.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Retrieve statistics for process. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_get_stats (const td_thragent_t *ta, td_ta_stats_t *statsp) -{ - /* XXX We have to figure out what has to be done. */ - LOG ("td_ta_get_stats"); - - /* 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_map_id2thr.c b/libpthread/linuxthreads_db/td_ta_map_id2thr.c deleted file mode 100644 index ddb6492e2..000000000 --- a/libpthread/linuxthreads_db/td_ta_map_id2thr.c +++ /dev/null @@ -1,79 +0,0 @@ -/* Map thread ID to thread handle. - Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include "thread_dbP.h" -#include "../linuxthreads/internals.h" - - -td_err_e -td_ta_map_id2thr (const td_thragent_t *ta, pthread_t pt, td_thrhandle_t *th) -{ - struct pthread_handle_struct phc; - struct _pthread_descr_struct pds; - int pthread_threads_max; - - LOG ("td_ta_map_id2thr"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - /* Make the following expression a bit smaller. */ - pthread_threads_max = ta->pthread_threads_max; - - /* We can compute the entry in the handle array we want. */ - if (ps_pdread (ta->ph, ta->handles + pt % pthread_threads_max, &phc, - sizeof (struct pthread_handle_struct)) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - /* Test whether this entry is in use. */ - if (phc.h_descr == NULL) - { - if (pt % pthread_threads_max == 0) - { - /* The initial thread always exists but the thread library - might not yet be initialized. */ - th->th_ta_p = (td_thragent_t *) ta; - th->th_unique = NULL; - - return TD_OK; - } - - return TD_BADTH; - } - - /* Next test: get the descriptor to see whether this is not an old - thread handle. */ - if (ps_pdread (ta->ph, phc.h_descr, &pds, - sizeof (struct _pthread_descr_struct)) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - if (pds.p_tid != pt) - return TD_BADTH; - - if (pds.p_terminated != 0) - return TD_NOTHR; - - /* Create the `td_thrhandle_t' object. */ - th->th_ta_p = (td_thragent_t *) ta; - th->th_unique = phc.h_descr; - - return TD_OK; -} diff --git a/libpthread/linuxthreads_db/td_ta_map_lwp2thr.c b/libpthread/linuxthreads_db/td_ta_map_lwp2thr.c deleted file mode 100644 index 1337a5c68..000000000 --- a/libpthread/linuxthreads_db/td_ta_map_lwp2thr.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Which thread is running on an lwp? - Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include "thread_dbP.h" -#include "../linuxthreads/internals.h" - - -td_err_e -td_ta_map_lwp2thr (const td_thragent_t *ta, lwpid_t lwpid, td_thrhandle_t *th) -{ - int pthread_threads_max = ta->pthread_threads_max; - size_t sizeof_descr = ta->sizeof_descr; - struct pthread_handle_struct phc[pthread_threads_max]; - size_t cnt; -#ifdef ALL_THREADS_STOPPED - int num; -#else -# define num 1 -#endif - - LOG ("td_ta_map_lwp2thr"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - /* Read all the descriptors. */ - if (ps_pdread (ta->ph, ta->handles, phc, - sizeof (struct pthread_handle_struct) * pthread_threads_max) - != PS_OK) - return TD_ERR; /* XXX Other error value? */ - -#ifdef ALL_THREADS_STOPPED - /* Read the number of currently active threads. */ - if (ps_pdread (ta->ph, ta->pthread_handles_num, &num, sizeof (int)) != PS_OK) - return TD_ERR; /* XXX Other error value? */ -#endif - - /* Get the entries one after the other and find out whether the ID - matches. */ - for (cnt = 0; cnt < pthread_threads_max && num > 0; ++cnt) - if (phc[cnt].h_descr != NULL) - { - struct _pthread_descr_struct pds; - -#ifdef ALL_THREADS_STOPPED - /* First count this active thread. */ - --num; -#endif - - if (ps_pdread (ta->ph, phc[cnt].h_descr, &pds, sizeof_descr) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - if ((pds.p_pid ?: ps_getpid (ta->ph)) == lwpid) - { - /* Found it. Now fill in the `td_thrhandle_t' object. */ - th->th_ta_p = (td_thragent_t *) ta; - th->th_unique = phc[cnt].h_descr; - - return TD_OK; - } - } - else if (cnt == 0) - { - /* The initial thread always exists. But it might not yet be - initialized. Construct a value. */ - th->th_ta_p = (td_thragent_t *) ta; - th->th_unique = NULL; - - return TD_OK; - } - - return TD_NOLWP; -} diff --git a/libpthread/linuxthreads_db/td_ta_new.c b/libpthread/linuxthreads_db/td_ta_new.c deleted file mode 100644 index 9bf926719..000000000 --- a/libpthread/linuxthreads_db/td_ta_new.c +++ /dev/null @@ -1,150 +0,0 @@ -/* Attach to target process. - Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include -#include - -#include "thread_dbP.h" - - -/* Datatype for the list of known thread agents. Normally there will - be exactly one so we don't spend much though on making it fast. */ -struct agent_list *__td_agent_list; - - -td_err_e -td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta) -{ - psaddr_t addr; - psaddr_t versaddr; - char versbuf[sizeof (VERSION)]; - struct agent_list *elemp; - - LOG ("td_ta_new"); - - /* Get the global event mask. This is one of the variables which - are new in the thread library to enable debugging. If it is - not available we cannot debug. */ - if (td_lookup (ps, PTHREAD_THREADS_EVENTS, &addr) != PS_OK) - return TD_NOLIBTHREAD; - - /* Check whether the versions match. */ - if (td_lookup (ps, LINUXTHREADS_VERSION, &versaddr) != PS_OK) - return TD_VERSION; - if (ps_pdread (ps, versaddr, versbuf, sizeof (versbuf)) != PS_OK) - return TD_ERR; - - versbuf[sizeof (versbuf) - 1] = '\0'; - if (strcmp (versbuf, VERSION) != 0) - /* Not the right version. */ - return TD_VERSION; - - /* Fill in the appropriate information. */ - *ta = (td_thragent_t *) malloc (sizeof (td_thragent_t)); - if (*ta == NULL) - return TD_MALLOC; - - /* Store the proc handle which we will pass to the callback functions - back into the debugger. */ - (*ta)->ph = ps; - - /* Remember the address. */ - (*ta)->pthread_threads_eventsp = (td_thr_events_t *) addr; - - /* Get the pointer to the variable pointing to the thread descriptor - with the last event. */ - if (td_lookup (ps, PTHREAD_LAST_EVENT, &(*ta)->pthread_last_event) != PS_OK) - { - free_return: - free (*ta); - return TD_ERR; - } - - /* Get the pointer to the variable containing the number of active - threads. */ - if (td_lookup (ps, PTHREAD_HANDLES_NUM, &(*ta)->pthread_handles_num) - != PS_OK) - goto free_return; - - /* See whether the library contains the necessary symbols. */ - if (td_lookup (ps, PTHREAD_HANDLES, &addr) != PS_OK) - goto free_return; - - (*ta)->handles = (struct pthread_handle_struct *) addr; - - - if (td_lookup (ps, PTHREAD_KEYS, &addr) != PS_OK) - goto free_return; - - /* Cast to the right type. */ - (*ta)->keys = (struct pthread_key_struct *) addr; - - /* Find out about the maximum number of threads. Old implementations - don't provide this information. In this case we assume that the - debug library is compiled with the same values. */ - if (td_lookup (ps, LINUXTHREADS_PTHREAD_THREADS_MAX, &addr) != PS_OK) - (*ta)->pthread_threads_max = PTHREAD_THREADS_MAX; - else - { - if (ps_pdread (ps, addr, &(*ta)->pthread_threads_max, sizeof (int)) - != PS_OK) - goto free_return; - } - - /* Similar for the maximum number of thread local data keys. */ - if (td_lookup (ps, LINUXTHREADS_PTHREAD_KEYS_MAX, &addr) != PS_OK) - (*ta)->pthread_keys_max = PTHREAD_KEYS_MAX; - else - { - if (ps_pdread (ps, addr, &(*ta)->pthread_keys_max, sizeof (int)) - != PS_OK) - goto free_return; - } - - /* And for the size of the second level arrays for the keys. */ - if (td_lookup (ps, LINUXTHREADS_PTHREAD_SIZEOF_DESCR, &addr) != PS_OK) - (*ta)->sizeof_descr = sizeof (struct _pthread_descr_struct); - else - { - if (ps_pdread (ps, addr, &(*ta)->sizeof_descr, sizeof (int)) != PS_OK) - goto free_return; - /* Don't let bogons in the inferior make us mess ourselves. */ - if ((*ta)->sizeof_descr > sizeof (struct _pthread_descr_struct)) - (*ta)->sizeof_descr = sizeof (struct _pthread_descr_struct); - - } - - /* Now add the new agent descriptor to the list. */ - elemp = (struct agent_list *) malloc (sizeof (struct agent_list)); - if (elemp == NULL) - { - /* Argh, now that everything else worked... */ - free (*ta); - return TD_MALLOC; - } - - /* We don't care for thread-safety here. */ - elemp->ta = *ta; - elemp->next = __td_agent_list; - __td_agent_list = elemp; - - return TD_OK; -} diff --git a/libpthread/linuxthreads_db/td_ta_reset_stats.c b/libpthread/linuxthreads_db/td_ta_reset_stats.c deleted file mode 100644 index b3ddbd07b..000000000 --- a/libpthread/linuxthreads_db/td_ta_reset_stats.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Reset statistics. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_reset_stats (const td_thragent_t *ta) -{ - /* XXX We have to figure out what has to be done. */ - LOG ("td_ta_reset_stats"); - - /* 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_set_event.c b/libpthread/linuxthreads_db/td_ta_set_event.c deleted file mode 100644 index 73cf9f405..000000000 --- a/libpthread/linuxthreads_db/td_ta_set_event.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Globally enable events. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_set_event (ta, event) - const td_thragent_t *ta; - td_thr_events_t *event; -{ - td_thr_events_t old_event; - int i; - - LOG ("td_ta_set_event"); - - /* 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? */ - - /* Or the new 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_setconcurrency.c b/libpthread/linuxthreads_db/td_ta_setconcurrency.c deleted file mode 100644 index 408e76309..000000000 --- a/libpthread/linuxthreads_db/td_ta_setconcurrency.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Set suggested concurrency level for process. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_setconcurrency (const td_thragent_t *ta, int level) -{ - /* This is something LinuxThreads does not support. */ - LOG ("td_ta_setconcurrency"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - return TD_NOCAPAB; -} diff --git a/libpthread/linuxthreads_db/td_ta_thr_iter.c b/libpthread/linuxthreads_db/td_ta_thr_iter.c deleted file mode 100644 index 2dad149d5..000000000 --- a/libpthread/linuxthreads_db/td_ta_thr_iter.c +++ /dev/null @@ -1,174 +0,0 @@ -/* Iterate over a process's threads. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include "thread_dbP.h" -#include "../linuxthreads/internals.h" -#include - -static int -handle_descr (const td_thragent_t *ta, td_thr_iter_f *callback, - void *cbdata_p, td_thr_state_e state, int ti_pri, - size_t cnt, pthread_descr descr) -{ - struct _pthread_descr_struct pds; - size_t sizeof_descr = ta->sizeof_descr; - td_thrhandle_t th; - - if (descr == NULL) - { - /* No descriptor (yet). */ - if (cnt == 0) - { - /* This is the main thread. Create a fake descriptor. */ - memset (&pds, '\0', sizeof (pds)); - - /* Empty thread descriptor the thread library would create. */ - pds.p_self = &pds; - pds.p_nextlive = pds.p_prevlive = &pds; - pds.p_tid = PTHREAD_THREADS_MAX; - /* The init code also sets up p_lock, p_errnop, p_herrnop, and - p_userstack but this should not be necessary here. */ - - th.th_ta_p = (td_thragent_t *) ta; - th.th_unique = NULL; - if (callback (&th, cbdata_p) != 0) - return TD_DBERR; - - /* All done successfully. */ - return TD_OK; - } - else if (cnt == 1) - /* The manager is not yet started. No big deal. */ - return TD_OK; - else - /* For every other thread this should not happen. */ - return TD_ERR; - } - - if (ps_pdread (ta->ph, descr, &pds, sizeof_descr) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - /* The manager thread must be handled special. The descriptor - exists but the thread only gets created when the first - `pthread_create' call is issued. A clear indication that this - happened is when the p_pid field is non-zero. */ - if (cnt == 1 && pds.p_pid == 0) - return TD_OK; - - /* Now test whether this thread matches the specified - conditions. */ - - /* Only if the priority level is as high or higher. */ - if (pds.p_priority < ti_pri) - return TD_OK; - - /* Test the state. - XXX This is incomplete. */ - if (state != TD_THR_ANY_STATE) - return TD_OK; - - /* XXX For now we ignore threads which are not running anymore. - The reason is that gdb tries to get the registers and fails. - In future we should have a special mode of the thread library - in which we keep the process around until the actual join - operation happened. */ - if (pds.p_exited != 0) - return TD_OK; - - /* Yep, it matches. Call the callback function. */ - th.th_ta_p = (td_thragent_t *) ta; - th.th_unique = descr; - if (callback (&th, cbdata_p) != 0) - return TD_DBERR; - - /* All done successfully. */ - return TD_OK; -} - - -td_err_e -td_ta_thr_iter (const td_thragent_t *ta, td_thr_iter_f *callback, - void *cbdata_p, td_thr_state_e state, int ti_pri, - sigset_t *ti_sigmask_p, unsigned int ti_user_flags) -{ - int pthread_threads_max; - struct pthread_handle_struct *phc; - td_err_e result = TD_OK; - int cnt; -#ifdef ALL_THREADS_STOPPED - int num; -#else -# define num 1 -#endif - - LOG ("td_ta_thr_iter"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - pthread_threads_max = ta->pthread_threads_max; - phc = (struct pthread_handle_struct *) alloca (sizeof (phc[0]) - * pthread_threads_max); - - /* First read only the main thread and manager thread information. */ - if (ps_pdread (ta->ph, ta->handles, phc, - sizeof (struct pthread_handle_struct) * 2) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - /* Now handle these descriptors. */ - result = handle_descr (ta, callback, cbdata_p, state, ti_pri, 0, - phc[0].h_descr); - if (result != TD_OK) - return result; - result = handle_descr (ta, callback, cbdata_p, state, ti_pri, 1, - phc[1].h_descr); - if (result != TD_OK) - return result; - - /* Read all the descriptors. */ - if (ps_pdread (ta->ph, ta->handles + 2, &phc[2], - (sizeof (struct pthread_handle_struct) - * (pthread_threads_max - 2))) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - -#ifdef ALL_THREADS_STOPPED - /* Read the number of currently active threads. */ - if (ps_pdread (ta->ph, ta->pthread_handles_num, &num, sizeof (int)) != PS_OK) - return TD_ERR; /* XXX Other error value? */ -#endif - - /* Now get all descriptors, one after the other. */ - for (cnt = 2; cnt < pthread_threads_max && num > 0; ++cnt) - if (phc[cnt].h_descr != NULL) - { -#ifdef ALL_THREADS_STOPPED - /* First count this active thread. */ - --num; -#endif - - result = handle_descr (ta, callback, cbdata_p, state, ti_pri, cnt, - phc[cnt].h_descr); - if (result != TD_OK) - break; - } - - return result; -} diff --git a/libpthread/linuxthreads_db/td_ta_tsd_iter.c b/libpthread/linuxthreads_db/td_ta_tsd_iter.c deleted file mode 100644 index 9e24250c6..000000000 --- a/libpthread/linuxthreads_db/td_ta_tsd_iter.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Iterate over a process's thread-specific data. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include "thread_dbP.h" -#include "../linuxthreads/internals.h" -#include - -td_err_e -td_ta_tsd_iter (const td_thragent_t *ta, td_key_iter_f *callback, - void *cbdata_p) -{ - struct pthread_key_struct *keys; - int pthread_keys_max; - int cnt; - - LOG ("td_ta_tsd_iter"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - pthread_keys_max = ta->pthread_keys_max; - keys = (struct pthread_key_struct *) alloca (sizeof (keys[0]) - * pthread_keys_max); - - /* Read all the information about the keys. */ - if (ps_pdread (ta->ph, ta->keys, keys, - sizeof (keys[0]) * pthread_keys_max) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - - /* Now get all descriptors, one after the other. */ - for (cnt = 0; cnt < pthread_keys_max; ++cnt) - if (keys[cnt].in_use - /* Return with an error if the callback returns a nonzero value. */ - && callback (cnt, keys[cnt].destr, cbdata_p) != 0) - return TD_DBERR; - - return TD_OK; -} diff --git a/libpthread/linuxthreads_db/td_thr_clear_event.c b/libpthread/linuxthreads_db/td_thr_clear_event.c deleted file mode 100644 index c027fc09f..000000000 --- a/libpthread/linuxthreads_db/td_thr_clear_event.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Disable specific event for thread. - Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include - -#include "thread_dbP.h" - - -td_err_e -td_thr_clear_event (th, event) - const td_thrhandle_t *th; - td_thr_events_t *event; -{ - td_thr_events_t old_event; - int i; - - LOG ("td_thr_clear_event"); - - /* If the thread descriptor has not yet been constructed do not do - anything. */ - if (th->th_unique == NULL) - return TD_OK; - - /* Write the new value into the thread data structure. */ - if (ps_pdread (th->th_ta_p->ph, - ((char *) th->th_unique - + offsetof (struct _pthread_descr_struct, - p_eventbuf.eventmask)), - &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 (th->th_ta_p->ph, - ((char *) th->th_unique - + offsetof (struct _pthread_descr_struct, - p_eventbuf.eventmask)), - &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_thr_dbresume.c b/libpthread/linuxthreads_db/td_thr_dbresume.c deleted file mode 100644 index 7b7f6eef9..000000000 --- a/libpthread/linuxthreads_db/td_thr_dbresume.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Resume execution of given thread. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_thr_dbresume (const td_thrhandle_t *th) -{ - /* XXX We have to figure out what has to be done. */ - LOG ("td_thr_dbresume"); - return TD_NOCAPAB; -} diff --git a/libpthread/linuxthreads_db/td_thr_dbsuspend.c b/libpthread/linuxthreads_db/td_thr_dbsuspend.c deleted file mode 100644 index ef668023d..000000000 --- a/libpthread/linuxthreads_db/td_thr_dbsuspend.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Suspend execution of given thread. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; 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_thr_dbsuspend (const td_thrhandle_t *th) -{ - /* XXX We have to figure out what has to be done. */ - LOG ("td_thr_dbsuspend"); - return TD_NOCAPAB; -} diff --git a/libpthread/linuxthreads_db/td_thr_event_enable.c b/libpthread/linuxthreads_db/td_thr_event_enable.c deleted file mode 100644 index 407f3fc44..000000000 --- a/libpthread/linuxthreads_db/td_thr_event_enable.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Enable event process-wide. - Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be us