This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT
Orjan Friberg wrote:
1. Add a check if the target cannot set "pure" read watchpoints to the
b->type == bp_read_watchpoint check at WP_VALUE_CHANGED (my
interpretation of Eli's suggestion).
On second thought, this actually is no good for a target which *can* set
pure read watchpoints. If there's both a watch and an rwatch on a
variable that is written, we'll get a false read watchpoint hit.
For the sake of argument, say that the implementation is called
TARGET_CANNOT_SET_PURE_READ_WATCHPOINTS (the i386 would return 1, my
target would return 0). The check for a read watchpoint would then be
case WP_VALUE_CHANGED:
if (b->type == bp_read_watchpoint
&& TARGET_CANNOT_SET_PURE_READ_WATCHPOINTS)
/* Don't stop. */
For i386, nothing would change. For my target, the following would
happen (foo is watched and rwatched, original value != 0):
a = foo; /* foo read; read watchpoint hits. */
foo = 1; /* foo written; write watchpoint hits, read watchpoint
hits incorrectly. */
--
Orjan Friberg
Axis Communications