This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
The threads saga: watchpoints
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb at sources dot redhat dot com
- Date: Fri, 7 Mar 2003 09:22:30 -0500
- Subject: The threads saga: watchpoints
It was pointed out to me today that watchpoints and threads really don't get
along. It's even in the manual:
_Warning:_ In multi-thread programs, watchpoints have only limited
usefulness. With the current watchpoint implementation, GDB can
only watch the value of an expression _in a single thread_. If
you are confident that the expression can only change due to the
current thread's activity (and if you are also confident that no
other thread can become current), then you can use watchpoints as
usual. However, GDB may not notice when a non-current thread's
activity changes the expression.
I think some of our hardware breakpoint implementations have the same issue.
It seems to me that, in general, this should be pretty easy to fix. But it
requires some definite changes in the current infrastructure. Shouldn't we
be able to insert the watchpoint in all threads?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer