This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
GDB breakpoint implementation for multithreaded programms
- From: Sofia <rodinasophie at gmail dot com>
- To: gdb at sourceware dot org
- Date: Sat, 10 May 2014 21:56:51 +0000 (UTC)
- Subject: GDB breakpoint implementation for multithreaded programms
- Authentication-results: sourceware.org; auth=none
I'm writing my GDB stub and trying to set breakpoints on different threads.
When I don't ask GDB about the number of threads, It works fine as a single-
threaded application and breakpoints are set correctly. But when I enter -
'info threads', something strange happens.
Firstly, GDB reads the contents of all threads' registers(it's OK). Then I
enter 'continue' and see that breakpoints are not set at all threads my
program has. I don't understand why, but the packet Z0(breakpoint packet) is
only sent to inactive thread. The documentation says that if the thread id is
not specified, breakpoints will be set at all threads. What's wrong with this
or where can I read about such GDB behavior?