]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 24 Aug 2002 03:35:35 +0000 (03:35 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 24 Aug 2002 03:35:35 +0000 (03:35 +0000)
2002-08-23  Ulrich Drepper  <drepper@redhat.com>

* pthread.c (__linuxthreads_version): New global constant.

linuxthreads/ChangeLog
linuxthreads/pthread.c
linuxthreads_db/ChangeLog
linuxthreads_db/td_symbol_list.c
linuxthreads_db/td_ta_new.c
linuxthreads_db/thread_db.h
linuxthreads_db/thread_dbP.h

index 728eaf8966a3277d384fe72fc9520585a2591284..814dba02b3930bb9a5d08d23ff05d05a87d9352f 100644 (file)
@@ -1,3 +1,7 @@
+2002-08-23  Ulrich Drepper  <drepper@redhat.com>
+
+       * pthread.c (__linuxthreads_version): New global constant.
+
 2002-08-23  Andreas Jaeger  <aj@suse.de>
 
        * sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs
index b0ef7fb1beba565956e2ea9dd7795788bfc33211..1848bfb31d61cdf4bf602db821db3f0bff08b104 100644 (file)
@@ -33,6 +33,7 @@
 #include <ldsodefs.h>
 #include <tls.h>
 #include <locale.h>            /* for __uselocale */
+#include <version.h>
 
 /* Sanity check.  */
 #if __ASSUME_REALTIME_SIGNALS && !defined __SIGRTMIN
@@ -238,6 +239,8 @@ const int __linuxthreads_pthread_sizeof_descr
 
 const int __linuxthreads_initial_report_events;
 
+const char __linuxthreads_version[] = VERSION;
+
 /* Forward declarations */
 
 static void pthread_onexit_process(int retcode, void *arg);
index f8028b4fcc02f37b3884858c2e163d23f9bb2fd1..a869c3c90a3c85e92d0893ae9ae17fd06e076d91 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-23  Ulrich Drepper  <drepper@redhat.com>
+
+       * thread_dbP.h: Define LINUXTHREADS_VERSION.
+       * td_symbol_list.c (symbol_list_arr): Add LINUXTHREADS_VERSION string.
+       * td_ta_new.c (td_ta_new): After verifying the thread library is
+       there check version.
+       * thread_db.h: Add new error TD_VERSION.
+
 2002-08-21  Roland McGrath  <roland@redhat.com>
 
        * td_thr_tls_get_addr.c (td_thr_tls_get_addr): __attribute_used__ ->
index 813261875c1e5b9585d68e8304496f3dea3042e1..2e8edeca4f4516da5344965f1c5b537328b5e5f2 100644 (file)
@@ -37,6 +37,7 @@ static const char *symbol_list_arr[] =
   [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
 };
 
index 7505f53e63c7dc367e7722c3f0aa08b1a83d1e16..50ddf0acc38c75953378329356dc741a0e9c586a 100644 (file)
@@ -1,5 +1,5 @@
 /* Attach to target process.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -20,6 +20,8 @@
 
 #include <stddef.h>
 #include <stdlib.h>
+#include <string.h>
+#include <version.h>
 
 #include "thread_dbP.h"
 
@@ -33,6 +35,8 @@ 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");
@@ -43,6 +47,17 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
   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)
index 65cdb8488648bfababe1aa28beacfd6700dc388d..906f48cd6e1f0d3bf80ef1b9843127826eab75b1 100644 (file)
@@ -52,7 +52,8 @@ typedef enum
   TD_MALLOC,     /* Out of memory.  */
   TD_PARTIALREG,  /* Not entire register set was read or written.  */
   TD_NOXREGS,    /* X register set not available for given thread.  */
-  TD_NOTALLOC    /* TLS memory not yet allocated.  */
+  TD_NOTALLOC,   /* TLS memory not yet allocated.  */
+  TD_VERSION     /* Version if libpthread and libthread_db do not match.  */
 } td_err_e;
 
 
index 85222abdf32e04faa5939b72cfa9e72c6d013d5d..8e0a78a3ac2af88a3747e508ef69f546af2a44d9 100644 (file)
@@ -24,6 +24,7 @@ enum
     LINUXTHREADS_DEATH_EVENT,
     LINUXTHREADS_REAP_EVENT,
     LINUXTHREADS_INITIAL_REPORT_EVENTS,
+    LINUXTHREADS_VERSION,
     NUM_MESSAGES
   };
 
This page took 0.054373 seconds and 5 git commands to generate.