[Bug breakpoints/8236] Watchpoints in multi-thread programs
pedro at codesourcery dot com
sourceware-bugzilla@sourceware.org
Tue Nov 17 21:28:00 GMT 2009
------- Additional Comments From pedro at codesourcery dot com 2009-11-17 21:28 -------
GDB supports hardware watchpoints on multi-thread programs nowadays (with
a few gotchas).
The text in question seems to have been replaced in the manual.
@cindex watchpoints and threads
@cindex threads and watchpoints
In multi-threaded programs, watchpoints will detect changes to the
watched expression from every thread.
@quotation
@emph{Warning:} In multi-threaded programs, software watchpoints
have only limited usefulness. If @value{GDBN} creates a software
watchpoint, it can only watch the value of an expression @emph{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
software watchpoints as usual. However, @value{GDBN} may not notice
when a non-current thread's activity changes the expression. (Hardware
watchpoints, in contrast, watch an expression in all threads.)
@end quotation
The issue with software watchpoints is that with the
default scheduler locking of off, when gdb steps a thread for a
watchpoint, other threads run free for a bit. This could be fixed by
stepping all threads simultaneously. Needs target_resume interface
changes to make it work in all-stop.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=8236
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the Gdb-prs
mailing list