]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* structs.def: Add a descriptor for pointer.val field of dtv_t.
authorRoland McGrath <roland@gnu.org>
Sat, 4 Feb 2006 00:48:40 +0000 (00:48 +0000)
committerRoland McGrath <roland@gnu.org>
Sat, 4 Feb 2006 00:48:40 +0000 (00:48 +0000)
* td_thr_tlsbase.c (td_thr_tlsbase): Extract pointer.val field from
DTV slot.

nptl_db/ChangeLog
nptl_db/structs.def
nptl_db/td_thr_tlsbase.c

index 52c8491384705a5fdaf72bad0eaa7e701f2df987..2bb82f488cc23c479d4cd0f9fe4b89cb0e14c366 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-03  Roland McGrath  <roland@redhat.com>
+
+       * structs.def: Add a descriptor for pointer.val field of dtv_t.
+       * td_thr_tlsbase.c (td_thr_tlsbase): Extract pointer.val field from
+       DTV slot.
+
 2004-09-09  Roland McGrath  <roland@redhat.com>
 
        * td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Don't abort if inferior's
index b17a628e0a7c13859e0010c5311858461b856f86..823af5cba21a4264f953d83dbe0c19ffdd607d49 100644 (file)
@@ -1,5 +1,5 @@
 /* List of types and symbols in libpthread examined by libthread_db.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006 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
@@ -74,6 +74,8 @@ DB_STRUCT_FIELD (link_map, l_tls_modid)
 
 #if !defined IS_IN_libpthread || USE_TLS
 DB_STRUCT_ARRAY_FIELD (dtv, dtv)
+# define pointer_val pointer.val /* Field of anonymous struct in dtv_t.  */
+DB_STRUCT_FIELD (dtv_t, pointer_val)
 #endif
 #if !defined IS_IN_libpthread || TLS_TCB_AT_TP
 DB_STRUCT_FIELD (pthread, dtvp)
index c57009a73ca23669891917ba927e623b0631f9e6..aaeda6f3c618eecb93e4928df3e78572f1396393 100644 (file)
@@ -1,5 +1,5 @@
 /* Locate TLS data for a thread.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006 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
@@ -25,7 +25,7 @@ td_thr_tlsbase (const td_thrhandle_t *th,
                psaddr_t *base)
 {
   td_err_e err;
-  psaddr_t dtv, dtvptr;
+  psaddr_t dtv, dtvslot, dtvptr;
 
   if (modid < 1)
     return TD_NOTLS;
@@ -35,8 +35,13 @@ td_thr_tlsbase (const td_thrhandle_t *th,
   if (err != TD_OK)
     return err;
 
-  /* Get the corresponding entry in the DTV.  */
-  err = DB_GET_FIELD (dtvptr, th->th_ta_p, dtv, dtv, dtv, modid);
+  /* Find the corresponding entry in the DTV.  */
+  err = DB_GET_FIELD_ADDRESS (dtvslot, th->th_ta_p, dtv, dtv, dtv, modid);
+  if (err != TD_OK)
+    return err;
+
+  /* Extract the TLS block address from that DTV slot.  */
+  err = DB_GET_FIELD (dtvptr, th->th_ta_p, dtvslot, dtv_t, pointer_val, 0);
   if (err != TD_OK)
     return err;