From 124af9f4b2b77b1510d88cfc8092c788d7e513c7 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 20 May 2005 19:02:51 +0000 Subject: Back out nptl changes, which for now will be done in branches/uClibc-nptl --- libpthread/nptl_db/ChangeLog | 207 -------------- libpthread/nptl_db/Makefile | 60 ---- libpthread/nptl_db/Versions | 24 -- libpthread/nptl_db/db_info.c | 103 ------- libpthread/nptl_db/fetch-value.c | 284 ------------------ libpthread/nptl_db/proc_service.h | 87 ------ libpthread/nptl_db/structs.def | 86 ------ libpthread/nptl_db/td_init.c | 32 --- libpthread/nptl_db/td_log.c | 32 --- libpthread/nptl_db/td_symbol_list.c | 85 ------ libpthread/nptl_db/td_ta_clear_event.c | 79 ----- libpthread/nptl_db/td_ta_delete.c | 42 --- libpthread/nptl_db/td_ta_enable_stats.c | 35 --- libpthread/nptl_db/td_ta_event_addr.c | 61 ---- libpthread/nptl_db/td_ta_event_getmsg.c | 105 ------- libpthread/nptl_db/td_ta_get_nthreads.c | 42 --- libpthread/nptl_db/td_ta_get_ph.c | 36 --- libpthread/nptl_db/td_ta_get_stats.c | 35 --- libpthread/nptl_db/td_ta_map_id2thr.c | 38 --- libpthread/nptl_db/td_ta_map_lwp2thr.c | 178 ------------ libpthread/nptl_db/td_ta_new.c | 65 ----- libpthread/nptl_db/td_ta_reset_stats.c | 35 --- libpthread/nptl_db/td_ta_set_event.c | 79 ----- libpthread/nptl_db/td_ta_setconcurrency.c | 35 --- libpthread/nptl_db/td_ta_thr_iter.c | 148 ---------- libpthread/nptl_db/td_ta_tsd_iter.c | 81 ------ libpthread/nptl_db/td_thr_clear_event.c | 77 ----- libpthread/nptl_db/td_thr_dbresume.c | 30 -- libpthread/nptl_db/td_thr_dbsuspend.c | 30 -- libpthread/nptl_db/td_thr_event_enable.c | 34 --- libpthread/nptl_db/td_thr_event_getmsg.c | 119 -------- libpthread/nptl_db/td_thr_get_info.c | 110 ------- libpthread/nptl_db/td_thr_getfpregs.c | 53 ---- libpthread/nptl_db/td_thr_getgregs.c | 53 ---- libpthread/nptl_db/td_thr_getxregs.c | 30 -- libpthread/nptl_db/td_thr_getxregsize.c | 30 -- libpthread/nptl_db/td_thr_set_event.c | 77 ----- libpthread/nptl_db/td_thr_setfpregs.c | 50 ---- libpthread/nptl_db/td_thr_setgregs.c | 50 ---- libpthread/nptl_db/td_thr_setprio.c | 30 -- libpthread/nptl_db/td_thr_setsigpending.c | 31 -- libpthread/nptl_db/td_thr_setxregs.c | 30 -- libpthread/nptl_db/td_thr_sigsetmask.c | 30 -- libpthread/nptl_db/td_thr_tls_get_addr.c | 43 --- libpthread/nptl_db/td_thr_tlsbase.c | 50 ---- libpthread/nptl_db/td_thr_tsd.c | 96 ------- libpthread/nptl_db/td_thr_validate.c | 91 ------ libpthread/nptl_db/thread_db.h | 459 ------------------------------ libpthread/nptl_db/thread_dbP.h | 254 ----------------- 49 files changed, 3951 deletions(-) delete mode 100644 libpthread/nptl_db/ChangeLog delete mode 100644 libpthread/nptl_db/Makefile delete mode 100644 libpthread/nptl_db/Versions delete mode 100644 libpthread/nptl_db/db_info.c delete mode 100644 libpthread/nptl_db/fetch-value.c delete mode 100644 libpthread/nptl_db/proc_service.h delete mode 100644 libpthread/nptl_db/structs.def delete mode 100644 libpthread/nptl_db/td_init.c delete mode 100644 libpthread/nptl_db/td_log.c delete mode 100644 libpthread/nptl_db/td_symbol_list.c delete mode 100644 libpthread/nptl_db/td_ta_clear_event.c delete mode 100644 libpthread/nptl_db/td_ta_delete.c delete mode 100644 libpthread/nptl_db/td_ta_enable_stats.c delete mode 100644 libpthread/nptl_db/td_ta_event_addr.c delete mode 100644 libpthread/nptl_db/td_ta_event_getmsg.c delete mode 100644 libpthread/nptl_db/td_ta_get_nthreads.c delete mode 100644 libpthread/nptl_db/td_ta_get_ph.c delete mode 100644 libpthread/nptl_db/td_ta_get_stats.c delete mode 100644 libpthread/nptl_db/td_ta_map_id2thr.c delete mode 100644 libpthread/nptl_db/td_ta_map_lwp2thr.c delete mode 100644 libpthread/nptl_db/td_ta_new.c delete mode 100644 libpthread/nptl_db/td_ta_reset_stats.c delete mode 100644 libpthread/nptl_db/td_ta_set_event.c delete mode 100644 libpthread/nptl_db/td_ta_setconcurrency.c delete mode 100644 libpthread/nptl_db/td_ta_thr_iter.c delete mode 100644 libpthread/nptl_db/td_ta_tsd_iter.c delete mode 100644 libpthread/nptl_db/td_thr_clear_event.c delete mode 100644 libpthread/nptl_db/td_thr_dbresume.c delete mode 100644 libpthread/nptl_db/td_thr_dbsuspend.c delete mode 100644 libpthread/nptl_db/td_thr_event_enable.c delete mode 100644 libpthread/nptl_db/td_thr_event_getmsg.c delete mode 100644 libpthread/nptl_db/td_thr_get_info.c delete mode 100644 libpthread/nptl_db/td_thr_getfpregs.c delete mode 100644 libpthread/nptl_db/td_thr_getgregs.c delete mode 100644 libpthread/nptl_db/td_thr_getxregs.c delete mode 100644 libpthread/nptl_db/td_thr_getxregsize.c delete mode 100644 libpthread/nptl_db/td_thr_set_event.c delete mode 100644 libpthread/nptl_db/td_thr_setfpregs.c delete mode 100644 libpthread/nptl_db/td_thr_setgregs.c delete mode 100644 libpthread/nptl_db/td_thr_setprio.c delete mode 100644 libpthread/nptl_db/td_thr_setsigpending.c delete mode 100644 libpthread/nptl_db/td_thr_setxregs.c delete mode 100644 libpthread/nptl_db/td_thr_sigsetmask.c delete mode 100644 libpthread/nptl_db/td_thr_tls_get_addr.c delete mode 100644 libpthread/nptl_db/td_thr_tlsbase.c delete mode 100644 libpthread/nptl_db/td_thr_tsd.c delete mode 100644 libpthread/nptl_db/td_thr_validate.c delete mode 100644 libpthread/nptl_db/thread_db.h delete mode 100644 libpthread/nptl_db/thread_dbP.h (limited to 'libpthread/nptl_db') diff --git a/libpthread/nptl_db/ChangeLog b/libpthread/nptl_db/ChangeLog deleted file mode 100644 index 52c849138..000000000 --- a/libpthread/nptl_db/ChangeLog +++ /dev/null @@ -1,207 +0,0 @@ -2004-09-09 Roland McGrath - - * td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Don't abort if inferior's - descriptor is bogus. - -2004-05-27 Roland McGrath - - * td_thr_validate.c: When we find no threads and the inferior appears - uninitialized, validate the main thread as a special case. - -2004-05-01 Jakub Jelinek - - * thread_dbP.h (LOG): Use write instead of __libc_write. - -2004-04-03 Ulrich Drepper - - * td_ta_set_event.c (td_ta_set_event): Initialize copy to avoid - warnings. - - * td_ta_thr_iter.c (td_ta_thr_iter): Initialize list to avoid warning. - * td_ta_clear_event.c (td_ta_clear_event): Initialize eventmask to - avoid warning. - * td_ta_set_event.c (td_ta_set_event): Likewise. - -2004-03-24 Roland McGrath - - * fetch-value.c (_td_locate_field): Cast DB_DESC_OFFSET to int32_t. - * thread_dbP.h (DB_DESC_OFFSET): Remove cast from definition. - -2004-03-13 Jakub Jelinek - - * db_info.c: Don't use TLS_TP_OFFSET in the #if, but - TLS_TCB_SIZE == 0 ?: in the DESC macro. - -2004-03-12 Roland McGrath - - * db_info.c [TLS_DTV_AT_TP && TLS_TP_OFFSET > 0] - (_thread_db_pthread_dtvp): Define differently for this case (PowerPC). - -2003-12-11 Ulrich Weigand - - * db_info.c (REGISTER): Add bit size of thread register as second - parameter to REGISTER macro. - -2003-12-02 Roland McGrath - - * thread_dbP.h (DB_FUNCTION): New macro. - * structs.def: Use it for __nptl_create_event and __nptl_death_event. - * db_info.c (DB_FUNCTION): New macro. - * td_symbol_list.c (DB_FUNCTION): New macro, prepend "." to symbol - name under [HAVE_ASM_GLOBAL_DOT_NAME]. - (td_lookup) [HAVE_ASM_GLOBAL_DOT_NAME]: If lookup fails with PS_NOSYM - and name starts with a dot, try it without the dot. - -2003-09-08 Roland McGrath - - * td_thr_get_info.c (td_thr_get_info): Cast th_unique to thread_t. - -2003-08-22 Roland McGrath - - * fetch-value.c (_td_check_sizeof, _td_locate_field): Return - TD_NOCAPAB for PS_NOSYM, instead of vanilla TD_ERR. - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Return TD_NOAPLIC when - DB_GET_FIELD returns TD_NOCAPAB. - - * thread_db.h (td_thr_tls_get_addr): Use psaddr_t in signature. - * structs.def [USE_TLS]: Add DB_STRUCT_FIELD (link_map, l_tls_modid). - * db_info.c (link_map): Typedef it. - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Rewritten. - -2003-08-14 Roland McGrath - - * thread_dbP.h: Mostly rewritten with many new macros and decls. - * td_ta_new.c (td_ta_new): Don't cache a lot of symbol values. - * structs.def: New file. - * db_info.c: New file. - * td_symbol_list.c (symbol_list_arr): Define with structs.def macros. - * td_ta_clear_event.c: Rewritten. - * td_ta_event_addr.c: Rewritten. - * td_ta_event_getmsg.c: Rewritten. - * td_ta_get_nthreads.c: Rewritten. - * td_ta_map_lwp2thr.c: New file. - * td_ta_set_event.c: Rewritten. - * td_ta_thr_iter.c: Rewritten. - * td_ta_tsd_iter.c: Rewritten. - * td_thr_clear_event.c: Rewritten. - * td_thr_event_enable.c: Rewritten. - * td_thr_event_getmsg.c: Rewritten. - * td_thr_get_info.c: Rewritten. - * td_thr_getfpregs.c: Rewritten. - * td_thr_getgregs.c: Rewritten. - * td_thr_set_event.c: Rewritten. - * td_thr_setfpregs.c: Rewritten. - * td_thr_setgregs.c: Rewritten. - * td_thr_tlsbase.c: Rewritten. - * td_thr_tsd.c: Rewritten. - * td_thr_validate.c: Rewritten. - * Makefile (distribute): Add them. - * fetch-value.c: New file. - * Makefile (libthread_db-routines): Add it. - - * thread_db.h (td_err_e): Comment fix. - -2003-08-05 Roland McGrath - - * thread_dbP.h (td_lookup): Add attribute_hidden to decl. - -2003-08-04 Roland McGrath - - * td_ta_clear_event.c (td_ta_clear_event): Fix sizes in ps_* calls. - -2003-06-23 Roland McGrath - - * proc_service.h: Cosmetic and comment fixes. - -2003-06-19 Roland McGrath - - * td_thr_event_enable.c (td_thr_event_enable): Use proper type `bool' - for value written into inferior's `report_events'. - -2003-03-18 Roland McGrath - - * td_thr_event_getmsg.c (td_thr_event_getmsg): Splice the thread out - of the ->nextevent linkage. - - * td_ta_event_getmsg.c (td_ta_event_getmsg): Runtime error instead of - assert for reading TD_EVENT_NONE. Clear the event buffer after - reading it. Add a sanity check for foo->nextevent = foo. - -2003-03-15 Roland McGrath - - * thread_db.h (td_err_e): Add TD_NOTLS and TD_TLSDEFER. - (td_thr_tlsbase): Declare it. - * td_thr_tlsbase.c: New file. - * Makefile (libthread_db-routines): Add it. - * Versions (libthread_db: GLIBC_2.3.3): New set, add td_thr_tlsbase. - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Use td_thr_tlsbase. - -2003-03-14 Roland McGrath - - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Use `header.' prefix. - -2003-03-10 Roland McGrath - - * td_ta_thr_iter.c (iterate_thread_list): Don't use `header.data.' - prefix for `struct pthread' members. - * td_thr_validate.c (check_thread_list): Likewise. - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Likewise. - -2003-03-03 Roland McGrath - - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Handle TLS_DTV_AT_TP. - -2003-02-15 Ulrich Drepper - - * td_symbol_list.c: New symbol name for SYM_PTHREAD_NTHREADS. - -2003-01-07 Jakub Jelinek - - * td_ta_event_getmsg.c: Include assert.h. - --2003-01-05 Ulrich Drepper - - * Makefile (libthread_db.so-no-z-defs): Define. - -2003-01-03 Roland McGrath - - * td_thr_setgregs.c (td_thr_setgregs): *_BIT -> *_BITMASK - * td_thr_setfpregs.c (td_thr_setfpregs): Likewise. - * td_thr_get_info.c (td_thr_get_info): Likewise. - * td_thr_getgregs.c (td_thr_getgregs): Likewise. - * td_thr_getfpregs.c (td_thr_getfpregs): Likewise. - * td_ta_thr_iter.c (iterate_thread_list): Likewise. - -2002-12-12 Roland McGrath - - * td_ta_thr_iter.c (iterate_thread_list): Handle special case of - uninitialized __stack_user (zeros), hard-wire just the main thread. - - * td_thr_get_info.c (td_thr_get_info): Fix ti_lid initialization. - -2002-12-06 Roland McGrath - - * td_ta_event_getmsg.c (td_ta_event_getmsg): Write the NEXT pointer - into the inferior's __pthread_last_event variable, not a word from - an inferior address used in the parent. Pass the address of a - null word to ps_pdwrite, not a null pointer. - -2002-12-04 Roland McGrath - - * td_thr_get_info.c (td_thr_get_info): ti_tid is pthread_t, not a PID. - - * thread_db.h (td_thrinfo_t): Comment fix. - - * td_ta_map_lwp2thr.c: Moved to ../nptl/sysdeps/i386/. - -2002-12-04 Ulrich Drepper - - * td_ta_thr_iter.c (iterate_thread_list): At end of iteration read - pointer to the next element from inferior. - -2002-12-02 Roland McGrath - - * td_symbol_list.c (symbol_list_arr): pthread_keys -> __pthread_keys - - * td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Fetch inferior registers to - see its %gs value, not our own. diff --git a/libpthread/nptl_db/Makefile b/libpthread/nptl_db/Makefile deleted file mode 100644 index 5c73ff28f..000000000 --- a/libpthread/nptl_db/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (C) 2002, 2003 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. - -# Makefile for NPTL debug library subdirectory of GNU C Library. - -subdir := nptl_db - -nptl_db-version = 1.0 - -extra-libs = libthread_db -extra-libs-others := $(extra-libs) - -headers = thread_db.h - -libthread_db-routines = td_init td_log td_ta_new td_ta_delete \ - td_ta_get_nthreads td_ta_get_ph \ - td_ta_map_id2thr td_ta_map_lwp2thr \ - td_ta_thr_iter td_ta_tsd_iter \ - td_thr_get_info td_thr_getfpregs td_thr_getgregs \ - td_thr_getxregs td_thr_getxregsize td_thr_setfpregs \ - td_thr_setgregs td_thr_setprio td_thr_setsigpending \ - td_thr_setxregs td_thr_sigsetmask td_thr_tsd \ - td_thr_validate td_thr_dbsuspend td_thr_dbresume \ - td_ta_setconcurrency td_ta_enable_stats \ - td_ta_reset_stats td_ta_get_stats td_ta_event_addr \ - td_thr_event_enable td_thr_set_event \ - td_thr_clear_event td_thr_event_getmsg \ - td_ta_set_event td_ta_event_getmsg \ - td_ta_clear_event td_symbol_list \ - td_thr_tlsbase td_thr_tls_get_addr \ - fetch-value - -libthread_db-inhibit-o = $(filter-out .os,$(object-suffixes)) - -# The ps_* callback functions are not defined. -libthread_db.so-no-z-defs = yes - -distribute = thread_dbP.h shlib-versions proc_service.h db_info.c structs.def -include ../Rules - -# Depend on libc.so so a DT_NEEDED is generated in the shared objects. -# This ensures they will load libc.so for needed symbols if loaded by -# a statically-linked program that hasn't already loaded it. -$(objpfx)libthread_db.so: $(common-objpfx)libc.so \ - $(common-objpfx)libc_nonshared.a diff --git a/libpthread/nptl_db/Versions b/libpthread/nptl_db/Versions deleted file mode 100644 index 063493c67..000000000 --- a/libpthread/nptl_db/Versions +++ /dev/null @@ -1,24 +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; - } - GLIBC_2.3.3 { - td_thr_tlsbase; - } -} diff --git a/libpthread/nptl_db/db_info.c b/libpthread/nptl_db/db_info.c deleted file mode 100644 index 5000b99ba..000000000 --- a/libpthread/nptl_db/db_info.c +++ /dev/null @@ -1,103 +0,0 @@ -/* This file is included by pthread_create.c to define in libpthread - all the magic symbols required by libthread_db. - - Copyright (C) 2003, 2004 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. */ - -#include "thread_dbP.h" -#include - -typedef struct pthread pthread; -typedef struct pthread_key_struct pthread_key_struct; -typedef struct pthread_key_data pthread_key_data; -typedef struct -{ - struct pthread_key_data data[PTHREAD_KEY_2NDLEVEL_SIZE]; -} -pthread_key_data_level2; - -typedef struct -{ - union dtv dtv[UINT32_MAX / 2 / sizeof (union dtv)]; /* No constant bound. */ -} dtv; - -typedef struct link_map link_map; - - -#define schedparam_sched_priority schedparam.sched_priority - -#define eventbuf_eventmask eventbuf.eventmask -#define eventbuf_eventmask_event_bits eventbuf.eventmask.event_bits - -#define DESC(name, offset, obj) \ - DB_DEFINE_DESC (name, 8 * sizeof (obj), 1, offset); -#define ARRAY_DESC(name, offset, obj) \ - DB_DEFINE_DESC (name, \ - 8 * sizeof (obj)[0], sizeof (obj) / sizeof (obj)[0], \ - offset); - -#if TLS_TCB_AT_TP -# define dtvp header.dtv -#elif TLS_DTV_AT_TP -/* Special case hack. If TLS_TCB_SIZE == 0 (on PowerPC), there is no TCB - containing the DTV at the TP, but actually the TCB lies behind the TP, - i.e. at the very end of the area covered by TLS_PRE_TCB_SIZE. */ -DESC (_thread_db_pthread_dtvp, - TLS_PRE_TCB_SIZE + offsetof (tcbhead_t, dtv) - - (TLS_TCB_SIZE == 0 ? sizeof (tcbhead_t) : 0), union dtv) -#endif - - -#define DB_STRUCT(type) \ - const uint32_t _thread_db_sizeof_##type = sizeof (type); -#define DB_STRUCT_FIELD(type, field) \ - DESC (_thread_db_##type##_##field, \ - offsetof (type, field), ((type *) 0)->field) -#define DB_STRUCT_ARRAY_FIELD(type, field) \ - ARRAY_DESC (_thread_db_##type##_##field, \ - offsetof (type, field), ((type *) 0)->field) -#define DB_VARIABLE(name) DESC (_thread_db_##name, 0, name) -#define DB_ARRAY_VARIABLE(name) ARRAY_DESC (_thread_db_##name, 0, name) -#define DB_SYMBOL(name) /* Nothing. */ -#define DB_FUNCTION(name) /* Nothing. */ -#include "structs.def" -#undef DB_STRUCT -#undef DB_STRUCT_FIELD -#undef DB_SYMBOL -#undef DB_FUNCTION -#undef DB_VARIABLE -#undef DESC - - - -#ifdef DB_THREAD_SELF -# ifdef DB_THREAD_SELF_INCLUDE -# include DB_THREAD_SELF_INCLUDE -# endif - -/* This macro is defined in the machine's tls.h using the three below. */ -# define CONST_THREAD_AREA(bits, value) \ - const uint32_t _thread_db_const_thread_area = (value); -# define REGISTER_THREAD_AREA(bits, regofs, scale) \ - DB_DEFINE_DESC (_thread_db_register##bits##_thread_area, \ - bits, (scale), (regofs)); -# define REGISTER(bits, size, regofs, bias) \ - DB_DEFINE_DESC (_thread_db_register##bits, size, (uint32_t)(bias), (regofs)); - -DB_THREAD_SELF -#endif diff --git a/libpthread/nptl_db/fetch-value.c b/libpthread/nptl_db/fetch-value.c deleted file mode 100644 index 0d9bb0eb8..000000000 --- a/libpthread/nptl_db/fetch-value.c +++ /dev/null @@ -1,284 +0,0 @@ -/* Helper routines for libthread_db. - Copyright (C) 2003, 2004 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. */ - -#include "thread_dbP.h" -#include -#include - -td_err_e -_td_check_sizeof (td_thragent_t *ta, uint32_t *sizep, int sizep_name) -{ - if (*sizep == 0) - { - psaddr_t descptr; - ps_err_e err = td_lookup (ta->ph, sizep_name, &descptr); - if (err == PS_NOSYM) - return TD_NOCAPAB; - if (err == PS_OK) - err = ps_pdread (ta->ph, descptr, sizep, sizeof *sizep); - if (err != PS_OK) - return TD_ERR; - if (*sizep & 0xff000000U) - *sizep = bswap_32 (*sizep); - } - return TD_OK; -} - -td_err_e -_td_locate_field (td_thragent_t *ta, - db_desc_t desc, int descriptor_name, - psaddr_t idx, psaddr_t *address) -{ - uint32_t elemsize; - - if (DB_DESC_SIZE (desc) == 0) - { - /* Read the information about this field from the inferior. */ - psaddr_t descptr; - ps_err_e err = td_lookup (ta->ph, descriptor_name, &descptr); - if (err == PS_NOSYM) - return TD_NOCAPAB; - if (err == PS_OK) - err = ps_pdread (ta->ph, descptr, desc, DB_SIZEOF_DESC); - if (err != PS_OK) - return TD_ERR; - if (DB_DESC_SIZE (desc) == 0) - return TD_DBERR; - if (DB_DESC_SIZE (desc) & 0xff000000U) - { - /* Byte-swap these words, though we leave the size word - in native order as the handy way to distinguish. */ - DB_DESC_OFFSET (desc) = bswap_32 (DB_DESC_OFFSET (desc)); - DB_DESC_NELEM (desc) = bswap_32 (DB_DESC_NELEM (desc)); - } - } - - if (idx != 0 && idx - (psaddr_t) 0 > DB_DESC_NELEM (desc)) - /* This is an internal indicator to callers with nonzero IDX - that the IDX value is too big. */ - return TD_NOAPLIC; - - elemsize = DB_DESC_SIZE (desc); - if (elemsize & 0xff000000U) - elemsize = bswap_32 (elemsize); - - *address += (int32_t) DB_DESC_OFFSET (desc); - *address += (elemsize / 8 * (idx - (psaddr_t) 0)); - return TD_OK; -} - -td_err_e -_td_fetch_value (td_thragent_t *ta, - db_desc_t desc, int descriptor_name, - psaddr_t idx, psaddr_t address, - psaddr_t *result) -{ - ps_err_e err; - td_err_e terr = _td_locate_field (ta, desc, descriptor_name, idx, &address); - if (terr != TD_OK) - return terr; - - if (DB_DESC_SIZE (desc) == 8 || DB_DESC_SIZE (desc) == bswap_32 (8)) - { - uint8_t value; - err = ps_pdread (ta->ph, address, &value, sizeof value); - *result = (psaddr_t) 0 + value; - } - else if (DB_DESC_SIZE (desc) == 32) - { - uint32_t value; - err = ps_pdread (ta->ph, address, &value, sizeof value); - *result = (psaddr_t) 0 + value; - } - else if (DB_DESC_SIZE (desc) == 64) - { - uint64_t value; - if (sizeof (psaddr_t) < 8) - return TD_NOCAPAB; - err = ps_pdread (ta->ph, address, &value, sizeof value); - *result = (psaddr_t) 0 + value; - } - else if (DB_DESC_SIZE (desc) == bswap_32 (32)) - { - uint32_t value; - err = ps_pdread (ta->ph, address, &value, sizeof value); - value = bswap_32 (value); - *result = (psaddr_t) 0 + value; - } - else if (DB_DESC_SIZE (desc) == bswap_32 (64)) - { - uint64_t value; - if (sizeof (psaddr_t) < 8) - return TD_NOCAPAB; - err = ps_pdread (ta->ph, address, &value, sizeof value); - value = bswap_64 (value); - *result = (psaddr_t) 0 + value; - } - else - return TD_DBERR; - - return err == PS_OK ? TD_OK : TD_ERR; -} - - -td_err_e -_td_store_value (td_thragent_t *ta, - uint32_t desc[2], int descriptor_name, psaddr_t idx, - psaddr_t address, psaddr_t widened_value) -{ - ps_err_e err; - td_err_e terr = _td_locate_field (ta, desc, descriptor_name, idx, &address); - if (terr != TD_OK) - return terr; - - if (DB_DESC_SIZE (desc) == 8 || DB_DESC_SIZE (desc) == bswap_32 (8)) - { - uint8_t value = widened_value - (psaddr_t) 0; - err = ps_pdwrite (ta->ph, address, &value, sizeof value); - } - else if (DB_DESC_SIZE (desc) == 32) - { - uint32_t value = widened_value - (psaddr_t) 0; - err = ps_pdwrite (ta->ph, address, &value, sizeof value); - } - else if (DB_DESC_SIZE (desc) == 64) - { - uint64_t value = widened_value - (psaddr_t) 0; - if (sizeof (psaddr_t) < 8) - return TD_NOCAPAB; - err = ps_pdwrite (ta->ph, address, &value, sizeof value); - } - else if (DB_DESC_SIZE (desc) == bswap_32 (32)) - { - uint32_t value = widened_value - (psaddr_t) 0; - value = bswap_32 (value); - err = ps_pdwrite (ta->ph, address, &value, sizeof value); - } - else if (DB_DESC_SIZE (desc) == bswap_32 (64)) - { - uint64_t value = widened_value - (psaddr_t) 0; - if (sizeof (psaddr_t) < 8) - return TD_NOCAPAB; - value = bswap_64 (value); - err = ps_pdwrite (ta->ph, address, &value, sizeof value); - } - else - return TD_DBERR; - - return err == PS_OK ? TD_OK : TD_ERR; -} - -td_err_e -_td_fetch_value_local (td_thragent_t *ta, - db_desc_t desc, int descriptor_name, psaddr_t idx, - void *address, - psaddr_t *result) -{ - td_err_e terr = _td_locate_field (ta, desc, descriptor_name, idx, &address); - if (terr != TD_OK) - return terr; - - if (DB_DESC_SIZE (desc) == 8 || DB_DESC_SIZE (desc) == bswap_32 (8)) - { - uint8_t value; - memcpy (&value, address, sizeof value); - *result = (psaddr_t) 0 + value; - } - else if (DB_DESC_SIZE (desc) == 32) - { - uint32_t value; - memcpy (&value, address, sizeof value); - *result = (psaddr_t) 0 + value; - } - else if (DB_DESC_SIZE (desc) == 64) - { - uint64_t value; - if (sizeof (psaddr_t) < 8) - return TD_NOCAPAB; - memcpy (&value, address, sizeof value); - *result = (psaddr_t) 0 + value; - } - else if (DB_DESC_SIZE (desc) == bswap_32 (32)) - { - uint32_t value; - memcpy (&value, address, sizeof value); - value = bswap_32 (value); - *result = (psaddr_t) 0 + value; - } - else if (DB_DESC_SIZE (desc) == bswap_32 (64)) - { - uint64_t value; - if (sizeof (psaddr_t) < 8) - return TD_NOCAPAB; - memcpy (&value, address, sizeof value); - value = bswap_64 (value); - *result = (psaddr_t) 0 + value; - } - else - return TD_DBERR; - - return TD_OK; -} - - -td_err_e -_td_store_value_local (td_thragent_t *ta, - uint32_t desc[2], int descriptor_name, psaddr_t idx, - void *address, psaddr_t widened_value) -{ - td_err_e terr = _td_locate_field (ta, desc, descriptor_name, idx, &address); - if (terr != TD_OK) - return terr; - - if (DB_DESC_SIZE (desc) == 8 || DB_DESC_SIZE (desc) == bswap_32 (8)) - { - uint8_t value = widened_value - (psaddr_t) 0; - memcpy (address, &value, sizeof value); - } - else if (DB_DESC_SIZE (desc) == 32) - { - uint32_t value = widened_value - (psaddr_t) 0; - memcpy (address, &value, sizeof value); - } - else if (DB_DESC_SIZE (desc) == 64) - { - uint64_t value = widened_value - (psaddr_t) 0; - if (sizeof (psaddr_t) < 8) - return TD_NOCAPAB; - memcpy (address, &value, sizeof value); - } - else if (DB_DESC_SIZE (desc) == bswap_32 (32)) - { - uint32_t value = widened_value - (psaddr_t) 0; - value = bswap_32 (value); - memcpy (address, &value, sizeof value); - } - else if (DB_DESC_SIZE (desc) == bswap_32 (64)) - { - uint64_t value = widened_value - (psaddr_t) 0; - if (sizeof (psaddr_t) < 8) - return TD_NOCAPAB; - value = bswap_64 (value); - memcpy (address, &value, sizeof value); - } - else - return TD_DBERR; - - return TD_OK; -} diff --git a/libpthread/nptl_db/proc_service.h b/libpthread/nptl_db/proc_service.h deleted file mode 100644 index d49e87ab3..000000000 --- a/libpthread/nptl_db/proc_service.h +++ /dev/null @@ -1,87 +0,0 @@ -/* Callback interface for libthread_db, functions users must define. - Copyright (C) 1999,2002,2003 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 - -/* Functions in this interface return one of these status codes. */ -typedef enum -{ - PS_OK, /* Generic "call succeeded". */ - PS_ERR, /* Generic error. */ - PS_BADPID, /* Bad process handle. */ - PS_BADLID, /* Bad LWP identifier. */ - PS_BADADDR, /* Bad address. */ - PS_NOSYM, /* Could not find given symbol. */ - PS_NOFREGS /* FPU register set not available for given LWP. */ -} ps_err_e; - - -/* This type is opaque in this interface. - It's defined by the user of libthread_db. */ -struct ps_prochandle; - - -/* Read or write process memory at the given address. */ -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); - - -/* Get and set the given LWP's general or FPU register set. */ -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 *); - -/* Return the PID of the process. */ -extern pid_t ps_getpid (struct ps_prochandle *); - -/* Fetch the special per-thread address associated with the given LWP. - This call is only used on a few platforms (most use a normal register). - The meaning of the `int' parameter is machine-dependent. */ -extern ps_err_e ps_get_thread_area (const struct ps_prochandle *, - lwpid_t, int, psaddr_t *); - - -/* Look up the named symbol in the named DSO in the symbol tables - associated with the process being debugged, filling in *SYM_ADDR - with the corresponding run-time address. */ -extern ps_err_e ps_pglobal_lookup (struct ps_prochandle *, - const char *object_name, - const char *sym_name, - psaddr_t *sym_addr); - - -/* Stop or continue the entire process. */ -extern ps_err_e ps_pstop (const struct ps_prochandle *); -extern ps_err_e ps_pcontinue (const struct ps_prochandle *); - -/* Stop or continue the given LWP alone. */ -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/nptl_db/structs.def b/libpthread/nptl_db/structs.def deleted file mode 100644 index b17a628e0..000000000 --- a/libpthread/nptl_db/structs.def +++ /dev/null @@ -1,86 +0,0 @@ -/* List of types and symbols in libpthread examined by libthread_db. - Copyright (C) 2003 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. */ - -#ifndef DB_STRUCT_ARRAY_FIELD -# define DB_STRUCT_ARRAY_FIELD(type, field) DB_STRUCT_FIELD (type, field) -# define DB_ARRAY_VARIABLE(name) DB_VARIABLE (name) -# define STRUCTS_DEF_DEFAULTS 1 -#endif - -DB_STRUCT (pthread) -DB_STRUCT_FIELD (pthread, list) -DB_STRUCT_FIELD (pthread, report_events) -DB_STRUCT_FIELD (pthread, tid) -DB_STRUCT_FIELD (pthread, start_routine) -DB_STRUCT_FIELD (pthread, cancelhandling) -DB_STRUCT_FIELD (pthread, schedpolicy) -DB_STRUCT_FIELD (pthread, schedparam_sched_priority) -DB_STRUCT_FIELD (pthread, specific) -DB_STRUCT_FIELD (pthread, eventbuf) -DB_STRUCT_FIELD (pthread, eventbuf_eventmask) -DB_STRUCT_ARRAY_FIELD (pthread, eventbuf_eventmask_event_bits) -DB_STRUCT_FIELD (pthread, nextevent) - -DB_STRUCT (list_t) -DB_STRUCT_FIELD (list_t, next) -DB_STRUCT_FIELD (list_t, prev) - -DB_STRUCT (td_thr_events_t) -DB_STRUCT_ARRAY_FIELD (td_thr_events_t, event_bits) - -DB_STRUCT (td_eventbuf_t) -DB_STRUCT_FIELD (td_eventbuf_t, eventnum) -DB_STRUCT_FIELD (td_eventbuf_t, eventdata) - -DB_SYMBOL (stack_used) -DB_SYMBOL (__stack_user) -DB_SYMBOL (nptl_version) -DB_FUNCTION (__nptl_create_event) -DB_FUNCTION (__nptl_death_event) -DB_SYMBOL (__nptl_threads_events) -DB_VARIABLE (__nptl_nthreads) -DB_VARIABLE (__nptl_last_event) - -DB_ARRAY_VARIABLE (__pthread_keys) -DB_STRUCT (pthread_key_struct) -DB_STRUCT_FIELD (pthread_key_struct, seq) -DB_STRUCT_FIELD (pthread_key_struct, destr) - -DB_STRUCT (pthread_key_data) -DB_STRUCT_FIELD (pthread_key_data, seq) -DB_STRUCT_FIELD (pthread_key_data, data) -DB_STRUCT (pthread_key_data_level2) -DB_STRUCT_ARRAY_FIELD (pthread_key_data_level2, data) - -#if USE_TLS -DB_STRUCT_FIELD (link_map, l_tls_modid) -#endif - -#if !defined IS_IN_libpthread || USE_TLS -DB_STRUCT_ARRAY_FIELD (dtv, dtv) -#endif -#if !defined IS_IN_libpthread || TLS_TCB_AT_TP -DB_STRUCT_FIELD (pthread, dtvp) -#endif - -#ifdef STRUCTS_DEF_DEFAULTS -# undef DB_STRUCT_ARRAY_FIELD -# undef DB_ARRAY_VARIABLE -# undef STRUCTS_DEF_DEFAULTS -#endif diff --git a/libpthread/nptl_db/td_init.c b/libpthread/nptl_db/td_init.c deleted file mode 100644 index 946ff7244..000000000 --- a/libpthread/nptl_db/td_init.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Initialization function of thread debugger support library. - 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" - -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/nptl_db/td_log.c b/libpthread/nptl_db/td_log.c deleted file mode 100644 index 52212a0e9..000000000 --- a/libpthread/nptl_db/td_log.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Noop, left for historical reasons. - 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" - - -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/nptl_db/td_symbol_list.c b/libpthread/nptl_db/td_symbol_list.c deleted file mode 100644 index 5d6c94e5b..000000000 --- a/libpthread/nptl_db/td_symbol_list.c +++ /dev/null @@ -1,85 +0,0 @@ -/* Return list of symbols the library can request. - Copyright (C) 2001, 2002, 2003 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 -#include "thread_dbP.h" - - -#ifdef HAVE_ASM_GLOBAL_DOT_NAME -# define DOT "." /* PPC64 requires . prefix on code symbols. */ -#else -# define DOT /* No prefix. */ -#endif - -static const char *symbol_list_arr[] = -{ -# define DB_STRUCT(type) \ - [SYM_SIZEOF_##type] = "_thread_db_sizeof_" #type, -# define DB_STRUCT_FIELD(type, field) \ - [SYM_##type##_FIELD_##field] = "_thread_db_" #type "_" #field, -# define DB_SYMBOL(name) \ - [SYM_##name] = #name, -# define DB_FUNCTION(name) \ - [SYM_##name] = DOT #name, -# define DB_VARIABLE(name) \ - [SYM_##name] = #name, \ - [SYM_DESC_##name] = "_thread_db_" #name, -# include "structs.def" -# undef DB_STRUCT -# undef DB_FUNCTION -# undef DB_SYMBOL -# undef DB_VARIABLE - - [SYM_TH_UNIQUE_CONST_THREAD_AREA] = "_thread_db_const_thread_area", - [SYM_TH_UNIQUE_REGISTER64] = "_thread_db_register64", - [SYM_TH_UNIQUE_REGISTER32] = "_thread_db_register32", - [SYM_TH_UNIQUE_REGISTER32_THREAD_AREA] = "_thread_db_register32_thread_area", - [SYM_TH_UNIQUE_REGISTER64_THREAD_AREA] = "_thread_db_register64_thread_area", - - [SYM_NUM_MESSAGES] = NULL -}; - - -const char ** -td_symbol_list (void) -{ - return symbol_list_arr; -} - - -ps_err_e -td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr) -{ - ps_err_e result; - assert (idx >= 0 && idx < SYM_NUM_MESSAGES); - result = ps_pglobal_lookup (ps, LIBPTHREAD_SO, symbol_list_arr[idx], - sym_addr); - -#ifdef HAVE_ASM_GLOBAL_DOT_NAME - /* For PowerPC, 64-bit uses dot symbols but 32-bit does not. - We could be a 64-bit libthread_db debugging a 32-bit libpthread. */ - if (result == PS_NOSYM && symbol_list_arr[idx][0] == '.') - result = ps_pglobal_lookup (ps, LIBPTHREAD_SO, &symbol_list_arr[idx][1], - sym_addr); -#endif - - return result; -} diff --git a/libpthread/nptl_db/td_ta_clear_event.c b/libpthread/nptl_db/td_ta_clear_event.c deleted file mode 100644 index 7a2850c4e..000000000 --- a/libpthread/nptl_db/td_ta_clear_event.c +++ /dev/null @@ -1,79 +0,0 @@ -/* Globally disable events. - Copyright (C) 1999, 2001, 2002, 2003, 2004 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_arg, event) - const td_thragent_t *ta_arg; - td_thr_events_t *event; -{ - td_thragent_t *const ta = (td_thragent_t *) ta_arg; - td_err_e err; - psaddr_t eventmask = 0; - void *copy = NULL; - - LOG ("td_ta_clear_event"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - /* Fetch the old event mask from the inferior and modify it in place. */ - err = DB_GET_SYMBOL (eventmask, ta, __nptl_threads_events); - if (err == TD_OK) - err = DB_GET_STRUCT (copy, ta, eventmask, td_thr_events_t); - if (err == TD_OK) - { - uint32_t idx; - for (idx = 0; idx < TD_EVENTSIZE; ++idx) - { - psaddr_t word; - uint32_t mask; - err = DB_GET_FIELD_LOCAL (word, ta, copy, - td_thr_events_t, event_bits, idx); - if (err != TD_OK) - break; - mask = (uintptr_t) word; - mask &= ~event->event_bits[idx]; - word = (psaddr_t) (uintptr_t) mask; - err = DB_PUT_FIELD_LOCAL (ta, copy, - td_thr_events_t, event_bits, idx, word); - if (err != TD_OK) - break; - } - if (err == TD_NOAPLIC) - { - err = TD_OK; - while (idx < TD_EVENTSIZE) - if (event->event_bits[idx++] != 0) - { - err = TD_NOEVENT; - break; - } - } - if (err == TD_OK) - /* Now write it back to the inferior. */ - err = DB_PUT_STRUCT (ta, eventmask, td_thr_events_t, copy); - } - - return err; -} diff --git a/libpthread/nptl_db/td_ta_delete.c b/libpthread/nptl_db/td_ta_delete.c deleted file mode 100644 index 57b90e57f..000000000 --- a/libpthread/nptl_db/td_ta_delete.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Detach 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 "thread_dbP.h" - - -td_err_e -td_ta_delete (td_thragent_t *ta) -{ - LOG ("td_ta_delete"); - - /* Safety check. Note that the test will also fail for TA == NULL. */ - if (!ta_ok (ta)) - return TD_BADTA; - - /* Remove the handle from the list. */ - list_del (&ta->list); - - /* The handle was allocated in `td_ta_new'. */ - free (ta); - - return TD_OK; -} diff --git a/libpthread/nptl_db/td_ta_enable_stats.c b/libpthread/nptl_db/td_ta_enable_stats.c deleted file mode 100644 index ec7014ad2..000000000 --- a/libpthread/nptl_db/td_ta_enable_stats.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Enable collection of statistics for 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 "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/nptl_db/td_ta_event_addr.c b/libpthread/nptl_db/td_ta_event_addr.c deleted file mode 100644 index 37196e643..000000000 --- a/libpthread/nptl_db/td_ta_event_addr.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Get event address. - Copyright (C) 1999,2001,2002,2003 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_arg, - td_event_e event, td_notify_t *addr) -{ - td_thragent_t *const ta = (td_thragent_t *) ta_arg; - td_err_e err; - psaddr_t taddr; - - LOG ("td_ta_event_addr"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - switch (event) - { - case TD_CREATE: - err = DB_GET_SYMBOL (taddr, ta, __nptl_create_event); - break; - - case TD_DEATH: - err = DB_GET_SYMBOL (taddr, ta, __nptl_death_event); - break; - - default: - /* Event cannot be handled. */ - return TD_NOEVENT; - } - - if (err == TD_OK) - { - /* Success, we got the address. */ - addr->type = NOTIFY_BPT; - addr->u.bptaddr = taddr; - } - - return err; -} diff --git a/libpthread/nptl_db/td_ta_event_getmsg.c b/libpthread/nptl_db/td_ta_event_getmsg.c deleted file mode 100644 index 6e68ff4ff..000000000 --- a/libpthread/nptl_db/td_ta_event_getmsg.c +++ /dev/null @@ -1,105 +0,0 @@ -/* Retrieve event. - Copyright (C) 1999, 2001, 2002, 2003 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" - - -td_err_e -td_ta_event_getmsg (const td_thragent_t *ta_arg, td_event_msg_t *msg) -{ - td_thragent_t *const ta = (td_thragent_t *) ta_arg; - td_err_e err; - psaddr_t eventbuf, eventnum, eventdata; - psaddr_t thp, next; - void *copy; - - /* XXX I cannot think of another way but using a static variable. */ - /* XXX Use at least __thread once it is possible. */ - static td_thrhandle_t th; - - LOG ("td_thr_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. */ - err = DB_GET_VALUE (thp, ta, __nptl_last_event, 0); - if (err != TD_OK) - return err; - - if (thp == 0) - /* Nothing waiting. */ - return TD_NOMSG; - - /* Copy the event message buffer in from the inferior. */ - err = DB_GET_FIELD_ADDRESS (eventbuf, ta, thp, pthread, eventbuf, 0); - if (err == TD_OK) - err = DB_GET_STRUCT (copy, ta, eventbuf, td_eventbuf_t); - if (err != TD_OK) - return err; - - /* Read the event details from the target thread. */ - err = DB_GET_FIELD_LOCAL (eventnum, ta, copy, td_eventbuf_t, eventnum, 0); - if (err != TD_OK) - return err; - /* If the structure is on the list there better be an event recorded. */ - if ((int) (uintptr_t) eventnum == TD_EVENT_NONE) - return TD_DBERR; - - /* Fill the user's data structure. */ - err = DB_GET_FIELD_LOCAL (eventdata, ta, copy, td_eventbuf_t, eventdata, 0); - if (err != TD_OK) - return err; - - /* Generate the thread descriptor. */ - th.th_ta_p = (td_thragent_t *) ta; - th.th_unique = thp; - - /* Fill the user's data structure. */ - msg->msg.data = (uintptr_t) eventdata; - msg->event = (uintptr_t) eventnum; - msg->th_p = &th; - - /* And clear the event message in the target. */ - memset (copy, 0, ta->ta_sizeof_td_eventbuf_t); - err = DB_PUT_STRUCT (ta, eventbuf, td_eventbuf_t, copy); - if (err != TD_OK) - return err; - - /* Get the pointer to the next descriptor with an event. */ - err = DB_GET_FIELD (next, ta, thp, pthread, nextevent, 0); - if (err != TD_OK) - return err; - - /* Store the pointer in the list head variable. */ - err = DB_PUT_VALUE (ta, __nptl_last_event, 0, next); - if (err != TD_OK) - return err; - - if (next != 0) - /* Clear the next pointer in the current descriptor. */ - err = DB_PUT_FIELD (ta, thp, pthread, nextevent, 0, 0); - - return err; -} diff --git a/libpthread/nptl_db/td_ta_get_nthreads.c b/libpthread/nptl_db/td_ta_get_nthreads.c deleted file mode 100644 index ffe78bd57..000000000 --- a/libpthread/nptl_db/td_ta_get_nthreads.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Get the number of threads in the process. - Copyright (C) 1999,2001,2002,2003 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_arg, int *np) -{ - td_thragent_t *const ta = (td_thragent_t *) ta_arg; - td_err_e err; - psaddr_t n; - - LOG ("td_ta_get_nthreads"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - /* Access the variable in the inferior that tells us. */ - err = DB_GET_VALUE (n, ta, __nptl_nthreads, 0); - if (err == TD_OK) - *np = (uintptr_t) n; - - return err; -} diff --git a/libpthread/nptl_db/td_ta_get_ph.c b/libpthread/nptl_db/td_ta_get_ph.c deleted file mode 100644 index 04e01fb73..000000000 --- a/libpthread/nptl_db/td_ta_get_ph.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Get external process 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" - - -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/nptl_db/td_ta_get_stats.c b/libpthread/nptl_db/td_ta_get_stats.c deleted file mode 100644 index d5d879c3e..000000000 --- a/libpthread/nptl_db/td_ta_get_stats.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Retrieve statistics for 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 "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/nptl_db/td_ta_map_id2thr.c b/libpthread/nptl_db/td_ta_map_id2thr.c deleted file mode 100644 index 189a67171..000000000 --- a/libpthread/nptl_db/td_ta_map_id2thr.c +++ /dev/null @@ -1,38 +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" - - -td_err_e -td_ta_map_id2thr (const td_thragent_t *ta, pthread_t pt, td_thrhandle_t *th) -{ - LOG ("td_ta_map_id2thr"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - /* Create the `td_thrhandle_t' object. */ - th->th_ta_p = (td_thragent_t *) ta; - th->th_unique = (psaddr_t) pt; - - return TD_OK; -} diff --git a/libpthread/nptl_db/td_ta_map_lwp2thr.c b/libpthread/nptl_db/td_ta_map_lwp2thr.c deleted file mode 100644 index 1e93210b9..000000000 --- a/libpthread/nptl_db/td_ta_map_lwp2thr.c +++ /dev/null @@ -1,178 +0,0 @@ -/* Which thread is running on an LWP? - Copyright (C) 2003, 2004 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. */ - -#include "thread_dbP.h" -#include -#include -#include - - -td_err_e -td_ta_map_lwp2thr (const td_thragent_t *ta_arg, - lwpid_t lwpid, td_thrhandle_t *th) -{ - td_thragent_t *const ta = (td_thragent_t *) ta_arg; - ps_err_e err; - td_err_e terr; - prgregset_t regs; - psaddr_t addr; - - LOG ("td_ta_map_lwp2thr"); - - /* Test whether the TA parameter is ok. */ - if (! ta_ok (ta)) - return TD_BADTA; - - if (ta->ta_howto == ta_howto_unknown) - { - /* We need to read in from the inferior the instructions what to do. */ - psaddr_t howto; - - err = td_lookup (ta->ph, SYM_TH_UNIQUE_CONST_THREAD_AREA, &howto); - if (err == PS_OK) - { - err = ps_pdread (ta->ph, howto, - &ta->ta_howto_data.const_thread_area, - sizeof ta->ta_howto_data.const_thread_area); - if (err != PS_OK) - return TD_ERR; - ta->ta_howto = ta_howto_const_thread_area; - if (ta->ta_howto_data.const_thread_area & 0xff000000U) - ta->ta_howto_data.const_thread_area - = bswap_32 (ta->ta_howto_data.const_thread_area); - } - else - { - switch (sizeof (regs[0])) - { - case 8: - err = td_lookup (ta->ph, SYM_TH_UNIQUE_REGISTER64, &howto); - if (err == PS_OK) - ta->ta_howto = ta_howto_reg; - else if (err == PS_NOSYM) - { - err = td_lookup (ta->ph, - SYM_TH_UNIQUE_REGISTER64_THREAD_AREA, - &howto); - if (err == PS_OK) - ta->ta_howto = ta_howto_reg_thread_area; - } - break; - - case 4: - err = td_lookup (ta->ph, SYM_TH_UNIQUE_REGISTER32, &howto); - if (err == PS_OK) - ta->ta_howto = ta_howto_reg; - else if (err == PS_NOSYM) - { - err = td_lookup (ta->ph, - SYM_TH_UNIQUE_REGISTER32_THREAD_AREA, - &howto); - if (err == PS_OK) - ta->ta_howto = ta_howto_reg_thread_area; - } - break; - - default: - abort (); - return TD_DBERR; - } - - if (err != PS_OK) - return TD_DBERR; - - /* For either of these methods we read in the same descriptor. */ - err = ps_pdread (ta->ph, howto, - ta->ta_howto_data.reg, DB_SIZEOF_DESC); - if (err != PS_OK) - return TD_ERR; - if (DB_DESC_SIZE (ta->ta_howto_data.reg) == 0) - return TD_DBERR; - if (DB_DESC_SIZE (ta->ta_howto_data.reg) & 0xff000000U) - { - /* Byte-swap these words, though we leave the size word - in native order as the handy way to distinguish. */ - DB_DESC_OFFSET (ta->ta_howto_data.reg) - = bswap_32 (DB_DESC_OFFSET (ta->ta_howto_data.reg)); - DB_DESC_NELEM (ta->ta_howto_data.reg) - = bswap_32 (DB_DESC_NELEM (ta->ta_howto_data.reg)); - } - } - } - - switch (ta->ta_howto) - { - case ta_howto_unknown: - return TD_DBERR; - - default: - return TD_DBERR; - - case ta_howto_reg: - /* On most machines, we are just looking at a register. */ - if (ps_lgetregs (ta->ph, lwpid, regs) != PS_OK) - return TD_ERR; - terr = _td_fetch_value_local (ta, ta->ta_howto_data.reg, -1, - 0, regs, &addr); - if (terr != TD_OK) - return terr; - /* In this descriptor the nelem word is overloaded as the bias. */ - addr += (int32_t) DB_DESC_NELEM (ta->ta_howto_data.reg); - th->th_unique = addr; - break; - - case ta_howto_const_thread_area: - /* Some hosts don't have this call and this case won't be used. */ -# pragma weak ps_get_thread_area - if (&ps_get_thread_area == NULL) - return TD_NOCAPAB; - - /* A la x86-64, there is a constant magic index for get_thread_area. */ - if (ps_get_thread_area (ta->ph, lwpid, - ta->ta_howto_data.const_thread_area, - &th->th_unique) != PS_OK) - return TD_ERR; /* XXX Other error value? */ - break; - - case ta_howto_reg_thread_area: - if (&ps_get_thread_area == NULL) - return TD_NOCAPAB; - - /* A la i386, there is a register with an index for get_thread_area. */ - if (ps_lgetregs (ta->ph, lwpid, regs) != PS_OK) - return TD_ERR; - terr = _td_fetch_value_local (ta, ta->ta_howto_data.reg_thread_area, -1, - 0, regs, &addr); - if (te