[parisc-linux] [PATCH] Fix debugging interface for nptl
Randolph Chung
tausq at debian.org
Thu Jul 12 19:33:56 MDT 2007
Jeff mentioned recently that with a NPTL-enabled glibc, gdb debugging of
any threaded app fails. For example:
(gdb) run
Starting program: /home/tausq/userspace/thread_test2
[Thread debugging using libthread_db enabled]
Error while reading shared library symbols:
find_new_threads_callback: cannot get thread info: generic error
Two fixes, one in glibc and one in gdb, are required to fix this. The
attached patch is the glibc portion.
2007-07-12 Randolph Chung <tausq at debian.org>
* sysdeps/hppa/nptl/tls.h (DB_THREAD_SELF): Fix definition.
Please apply if ok.
randolph
-------------- next part --------------
Fix the register offset for libthread_db to do THREAD_SELF properly.
--- ports/sysdeps/hppa/nptl/tls.h.orig 2007-07-11 22:57:36.000000000 +0000
+++ ports/sysdeps/hppa/nptl/tls.h 2007-07-11 22:57:50.000000000 +0000
@@ -117,10 +117,11 @@
__self - 1; \
})
-/* FIXME */
-/* Magic for libthread_db to know how to do THREAD_SELF. */
+/* Magic for libthread_db to know how to do THREAD_SELF.
+ Our thread pointer is stored in cr27. See asm/elf.h for the offset into
+ elf_gregset_t. The thread descriptor is sizeof (struct pthread) away. */
# define DB_THREAD_SELF \
- REGISTER (32, 32, 32 * 4, -sizeof (struct pthread))
+ REGISTER (32, 32, 53 * 4, -sizeof (struct pthread))
/* Access to data in the thread descriptor is easy. */
# define THREAD_GETMEM(descr, member) \
More information about the parisc-linux
mailing list