This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
thread-debuging with gdbserver on ARM/NPTL
- From: Benedikt Spranger <b dot spranger at linutronix dot de>
- To: gdb at sourceware dot org
- Date: Tue, 24 Oct 2006 20:29:33 +0200
- Subject: thread-debuging with gdbserver on ARM/NPTL
Hi,
trying to debug a simple multithreaded application with gdbserver on an
ARM eabi/NPTL based System leads to a completely confused gdbserver.
thread_code() {
BP2 do_thread_init();
pthread_lock();
do_thread_work();
pthread_unlock();
}
main() {
pthread_lock()
pthread_create()
BP1 do_something()
pthread_unlock()
}
Attaching gdb to gdbserver, set the above breakpoints and issue "cont",
then the program stops at breakpoint BP1. BP2 is never reached, although
the thread is visible via "ps" on the target system. The thread is stuck
in sys_futex and not as expected in the ptrace breakpoint trap. Also gdb
does not show that the thread was created.
This can be reproduced with glibc 2.3.6 -> 2.5, kernel 2.6.14 ->
2.6.19-rc2, gcc 3.4 -> 4.1.1 and binutils up to cvs-latest.
Benedikt Spranger