From 92a4cba76076ce1aa0efa7b859708e057c2a757f Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 12 Jul 2018 09:24:36 +0200 Subject: 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. --- sysdeps/riscv/nptl/tls.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sysdeps/riscv') 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) \ -- cgit 1.4.1