about summary refs log tree commit diff
path: root/sysdeps/riscv
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2018-07-12 09:24:36 +0200
committerPalmer Dabbelt <palmer@sifive.com>2018-08-06 12:51:59 -0700
commit92a4cba76076ce1aa0efa7b859708e057c2a757f (patch)
tree67d56ace5042e99bbed8184f6330ae77b2a45f50 /sysdeps/riscv
parentfb4c32aef64500c65c7fc95ca06d7e17d467be45 (diff)
downloadglibc-92a4cba76076ce1aa0efa7b859708e057c2a757f.tar.gz
glibc-92a4cba76076ce1aa0efa7b859708e057c2a757f.tar.xz
glibc-92a4cba76076ce1aa0efa7b859708e057c2a757f.zip
RISC-V: Don't use ps_get_thread_area in libthread_db (bug 23402)
Since RISC-V stores the thread pointer in a general register libthread_db
can just ask the debugger for the register contents instead of trying to
call ps_get_thread_area.  This enables thread debugging in gdb.

	* sysdeps/riscv/nptl/tls.h (DB_THREAD_SELF): Use REGISTER instead
	of CONST_THREAD_AREA.
Diffstat (limited to 'sysdeps/riscv')
-rw-r--r--sysdeps/riscv/nptl/tls.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/riscv/nptl/tls.h b/sysdeps/riscv/nptl/tls.h
index 7745d59044..79383e97f1 100644
--- a/sysdeps/riscv/nptl/tls.h
+++ b/sysdeps/riscv/nptl/tls.h
@@ -99,9 +99,10 @@ typedef struct
 # define TLS_DEFINE_INIT_TP(tp, pd) \
   void *tp = (void *) (pd) + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE
 
-/* Magic for libthread_db to know how to do THREAD_SELF.  */
+/* Informs libthread_db that the thread pointer is register 4, which is used
+ * to know how to do THREAD_SELF.  */
 # define DB_THREAD_SELF \
-  CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
+  REGISTER (64, 64, 4 * 8, - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
 
 /* Access to data in the thread descriptor is easy.  */
 # define THREAD_GETMEM(descr, member) \