This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] RISC-V: Don't use ps_get_thread_area in libthread_db (bug 23402)
- From: Andreas Schwab <schwab at suse dot de>
- To: libc-alpha at sourceware dot org
- Cc: Palmer Dabbelt <palmer at dabbelt dot com>, Jim Wilson <jimw at sifive dot com>
- Date: Thu, 12 Jul 2018 09:24:36 +0200
- Subject: [PATCH] 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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysdeps/riscv/nptl/tls.h b/sysdeps/riscv/nptl/tls.h
index 7745d59044..9fa43f2708 100644
--- a/sysdeps/riscv/nptl/tls.h
+++ b/sysdeps/riscv/nptl/tls.h
@@ -101,7 +101,7 @@ typedef struct
/* Magic for libthread_db 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) \
--
2.18.0
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."