aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-09-09 07:01:01 +0000
committerRoland McGrath <roland@gnu.org>2003-09-09 07:01:01 +0000
commit7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc (patch)
tree5796d7f5d713c3c264a70a6039b0ba52e262b06f
parent416be7f049391ce421d9b12a2c3b81bb3cad9f58 (diff)
downloadglibc-7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc.tar.xz
glibc-7f08f55a9f88d23fcfbf1fed00f4d5a094e5fffc.zip
* sysdeps/unix/sysv/linux/speed.c
(cfsetospeed): Only set c_ospeed under [_HAVE_STRUCT_TERMIOS_C_OSPEED]. (cfsetispeed): Only set c_ispeed under [_HAVE_STRUCT_TERMIOS_C_ISPEED]. * sysdeps/unix/sysv/linux/bits/termios.h (_HAVE_STRUCT_TERMIOS_C_ISPEED, _HAVE_STRUCT_TERMIOS_C_OSPEED): Define. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
-rw-r--r--ChangeLog10
-rw-r--r--nptl/ChangeLog24
-rw-r--r--nptl/pthread_create.c7
-rw-r--r--nptl/pthread_key_create.c6
-rw-r--r--nptl/sysdeps/alpha/td_ta_map_lwp2thr.c46
-rw-r--r--nptl/sysdeps/alpha/tls.h4
-rw-r--r--nptl/sysdeps/generic/td_ta_map_lwp2thr.c45
-rw-r--r--nptl/sysdeps/i386/td_ta_map_lwp2thr.c48
-rw-r--r--nptl/sysdeps/i386/tls.h5
-rw-r--r--nptl/sysdeps/ia64/td_ta_map_lwp2thr.c44
-rw-r--r--nptl/sysdeps/ia64/tls.h3
-rw-r--r--nptl/sysdeps/powerpc/td_ta_map_lwp2thr.c44
-rw-r--r--nptl/sysdeps/powerpc/tls.h7
-rw-r--r--nptl/sysdeps/s390/td_ta_map_lwp2thr.c45
-rw-r--r--nptl/sysdeps/s390/tls.h3
-rw-r--r--nptl/sysdeps/sh/td_ta_map_lwp2thr.c44
-rw-r--r--nptl/sysdeps/sh/tls.h3
-rw-r--r--nptl/sysdeps/sparc/td_ta_map_lwp2thr.c44
-rw-r--r--nptl/sysdeps/sparc/tls.h5
-rw-r--r--nptl/sysdeps/x86_64/td_ta_map_lwp2thr.c43
-rw-r--r--nptl/sysdeps/x86_64/tls.h3
-rw-r--r--nptl_db/ChangeLog61
-rw-r--r--nptl_db/Makefile5
-rw-r--r--nptl_db/db_info.c98
-rw-r--r--nptl_db/fetch-value.c283
-rw-r--r--nptl_db/proc_service.h100
-rw-r--r--nptl_db/structs.def86
-rw-r--r--nptl_db/td_symbol_list.c33
-rw-r--r--nptl_db/td_ta_clear_event.c65
-rw-r--r--nptl_db/td_ta_event_addr.c36
-rw-r--r--nptl_db/td_ta_event_getmsg.c91
-rw-r--r--nptl_db/td_ta_get_nthreads.c21
-rw-r--r--nptl_db/td_ta_map_lwp2thr.c179
-rw-r--r--nptl_db/td_ta_new.c60
-rw-r--r--nptl_db/td_ta_set_event.c65
-rw-r--r--nptl_db/td_ta_thr_iter.c137
-rw-r--r--nptl_db/td_ta_tsd_iter.c60
-rw-r--r--nptl_db/td_thr_clear_event.c67
-rw-r--r--nptl_db/td_thr_event_enable.c12
-rw-r--r--nptl_db/td_thr_event_getmsg.c92
-rw-r--r--nptl_db/td_thr_get_info.c80
-rw-r--r--nptl_db/td_thr_getfpregs.c23
-rw-r--r--nptl_db/td_thr_getgregs.c27
-rw-r--r--nptl_db/td_thr_set_event.c67
-rw-r--r--nptl_db/td_thr_setfpregs.c23
-rw-r--r--nptl_db/td_thr_setgregs.c23
-rw-r--r--nptl_db/td_thr_tls_get_addr.c34
-rw-r--r--nptl_db/td_thr_tlsbase.c39
-rw-r--r--nptl_db/td_thr_tsd.c81
-rw-r--r--nptl_db/td_thr_validate.c62
-rw-r--r--nptl_db/thread_db.h6
-rw-r--r--nptl_db/thread_dbP.h239
52 files changed, 1718 insertions, 1020 deletions
diff --git a/ChangeLog b/ChangeLog
index fc7f671a55..41acb7f98f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-09-08 Roland McGrath <roland@frob.com>
+
+ * sysdeps/unix/sysv/linux/speed.c
+ (cfsetospeed): Only set c_ospeed under [_HAVE_STRUCT_TERMIOS_C_OSPEED].
+ (cfsetispeed): Only set c_ispeed under [_HAVE_STRUCT_TERMIOS_C_ISPEED].
+ * sysdeps/unix/sysv/linux/bits/termios.h
+ (_HAVE_STRUCT_TERMIOS_C_ISPEED, _HAVE_STRUCT_TERMIOS_C_OSPEED): Define.
+ * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise.
+
2003-09-08 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/register-dump.h: Undo last change.
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 0b16c02fa9..dba84a4e7f 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,27 @@
+2003-09-05 Roland McGrath <roland@redhat.com>
+
+ * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
+ Instead, include ../nptl_db/db_info.c to do its magic.
+ * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
+ (__pthread_pthread_key_2ndlevel_size): Likewise.
+ * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
+ * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
+ * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
+ * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
+ * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
+ * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
+ * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
+ * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
+ * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
+ * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
+ * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
+ * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
+ * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
+ * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
+ * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
+ * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
+ * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
+
2003-09-08 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 49825f093e..f8ab269bdd 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -60,9 +60,6 @@ struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]
__attribute__ ((nocommon));
hidden_data_def (__pthread_keys)
-/* This is for libthread_db only. */
-const int __pthread_pthread_sizeof_descr = sizeof (struct pthread);
-
struct pthread *
internal_function
__find_in_stack_list (pd)
@@ -475,3 +472,7 @@ __pthread_create_2_0 (newthread, attr, start_routine, arg)
compat_symbol (libpthread, __pthread_create_2_0, pthread_create,
GLIBC_2_0);
#endif
+
+/* Information for libthread_db. */
+
+#include "../nptl_db/db_info.c"
diff --git a/nptl/pthread_key_create.c b/nptl/pthread_key_create.c
index 7827d9affc..cf35bc8776 100644
--- a/nptl/pthread_key_create.c
+++ b/nptl/pthread_key_create.c
@@ -24,12 +24,6 @@
/* Internal mutex for __pthread_keys table handling. */
lll_lock_t __pthread_keys_lock = LLL_LOCK_INITIALIZER;
-
-/* For debugging purposes put the maximum number of keys in a variable. */
-const int __pthread_pthread_keys_max = PTHREAD_KEYS_MAX;
-const int __pthread_pthread_key_2ndlevel_size = PTHREAD_KEY_2NDLEVEL_SIZE;
-
-
int
__pthread_key_create (key, destr)
pthread_key_t *key;
diff --git a/nptl/sysdeps/alpha/td_ta_map_lwp2thr.c b/nptl/sysdeps/alpha/td_ta_map_lwp2thr.c
deleted file mode 100644
index b30b10b123..0000000000
--- a/nptl/sysdeps/alpha/td_ta_map_lwp2thr.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Which thread is running on an LWP? PowerPC version.
- 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. */
-
-#include "thread_dbP.h"
-#include <tls.h>
-
-
-td_err_e
-td_ta_map_lwp2thr (const td_thragent_t *ta, lwpid_t lwpid, td_thrhandle_t *th)
-{
- LOG ("td_ta_map_lwp2thr");
-
- /* Test whether the TA parameter is ok. */
- if (! ta_ok (ta))
- return TD_BADTA;
-
- prgregset_t regs;
- if (ps_lgetregs (ta->ph, lwpid, regs) != PS_OK)
- return TD_ERR;
-
- /* The uniq value is stored in slot 33 in recent gdb; it isn't stored
- anywhere otherwise. */
- th->th_unique = ((void *) regs[32]
- - TLS_TCB_OFFSET - TLS_TCB_SIZE - TLS_PRE_TCB_SIZE);
-
- /* Found it. Now complete the `td_thrhandle_t' object. */
- th->th_ta_p = (td_thragent_t *) ta;
-
- return TD_OK;
-}
diff --git a/nptl/sysdeps/alpha/tls.h b/nptl/sysdeps/alpha/tls.h
index 1718b3e466..8f61bb7409 100644
--- a/nptl/sysdeps/alpha/tls.h
+++ b/nptl/sysdeps/alpha/tls.h
@@ -118,6 +118,10 @@ typedef struct
((struct pthread *) (__builtin_thread_pointer () \
- TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
+/* Magic for libthread_db to know how to do THREAD_SELF. */
+# define DB_THREAD_SELF \
+ REGISTER (64, 32 * 8, - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+
/* Identifier for the current thread. THREAD_SELF is usable but
sometimes more expensive than necessary as in this case. */
# define THREAD_ID (__builtin_thread_pointer ())
diff --git a/nptl/sysdeps/generic/td_ta_map_lwp2thr.c b/nptl/sysdeps/generic/td_ta_map_lwp2thr.c
deleted file mode 100644
index 126673e9af..0000000000
--- a/nptl/sysdeps/generic/td_ta_map_lwp2thr.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Which thread is running on an LWP? Stub version.
- Copyright (C) 2002 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 <tls.h>
-#include <sys/reg.h>
-
-
-td_err_e
-td_ta_map_lwp2thr (const td_thragent_t *ta, lwpid_t lwpid, td_thrhandle_t *th)
-{
- LOG ("td_ta_map_lwp2thr");
-
- /* Test whether the TA parameter is ok. */
- if (! ta_ok (ta))
- return TD_BADTA;
-
- prgregset_t regs;
- if (ps_lgetregs (ta->ph, lwpid, regs) != PS_OK)
- return TD_ERR;
-
-# error port this file
- // th->th_unique = thread register;
-
- /* Found it. Now complete the `td_thrhandle_t' object. */
- th->th_ta_p = (td_thragent_t *) ta;
-
- return TD_OK;
-}
diff --git a/nptl/sysdeps/i386/td_ta_map_lwp2thr.c b/nptl/sysdeps/i386/td_ta_map_lwp2thr.c
deleted file mode 100644
index 94f6d34987..0000000000
--- a/nptl/sysdeps/i386/td_ta_map_lwp2thr.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Which thread is running on an LWP? i386 version.
- Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 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 <tls.h>
-#include <sys/reg.h>
-
-
-td_err_e
-td_ta_map_lwp2thr (const td_thragent_t *ta, lwpid_t lwpid, td_thrhandle_t *th)
-{
- LOG ("td_ta_map_lwp2thr");
-
- /* Test whether the TA parameter is ok. */
- if (! ta_ok (ta))
- return TD_BADTA;
-
- prgregset_t regs;
- if (ps_lgetregs (ta->ph, lwpid, regs) != PS_OK)
- return TD_ERR;
-
- /* Get the thread area for the addressed thread. */
- if (ps_get_thread_area (ta->ph, lwpid, regs[GS] >> 3, &th->th_unique)
- != PS_OK)
- return TD_ERR; /* XXX Other error value? */
-
- /* Found it. Now complete the `td_thrhandle_t' object. */
- th->th_ta_p = (td_thragent_t *) ta;
-
- return TD_OK;
-}
diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h
index 85d6473380..873467ca77 100644
--- a/nptl/sysdeps/i386/tls.h
+++ b/nptl/sysdeps/i386/tls.h
@@ -251,6 +251,11 @@ union user_desc_init
: "i" (offsetof (struct pthread, header.self))); \
__self;})
+/* Magic for libthread_db to know how to do THREAD_SELF. */
+# define DB_THREAD_SELF \
+ REGISTER_THREAD_AREA (32, offsetof (struct user_regs_struct, xgs), 3) \
+ REGISTER_THREAD_AREA (64, 26 * 8, 3) /* x86-64's user_regs_struct->gs */
+
/* Read member of the thread descriptor directly. */
# define THREAD_GETMEM(descr, member) \
diff --git a/nptl/sysdeps/ia64/td_ta_map_lwp2thr.c b/nptl/sysdeps/ia64/td_ta_map_lwp2thr.c
deleted file mode 100644
index b9f32eb8a1..0000000000
--- a/nptl/sysdeps/ia64/td_ta_map_lwp2thr.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Which thread is running on an LWP? IA-64 version.
- 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