Re: Hardware watchpoints; dealing with false triggers?

Orjan Friberg
2001-12-04T13:51:30Z

Eli Zaretskii wrote:
>
> I need to correct myself: there's a subtle point I forgot to mention.
> The current code only calls target_stopped_data_address for read and
> access watchpoints (those set by `rwatch' and `awatch' commands), but not
> for regular, i.e. data-write, hardware watchpoints (those set by `watch'
> command). Instead, GDB compares the previous and the current value of
> the watched expression, and if they differ, it decides that the
> corresponding watchpoint triggered, without ever considering the address!

Hm, I explicitly considered that a non-problem. (In my original post in
this thread I wrote: "For the current [data-]write watchpoint
implementation in gdb, false triggers wouldn't be a problem, since the
value of the variable wouldn't change.") The way hardware data-write
watchpoints work now, the lack of a target_stopped_data_address wouldn't
matter, since gdb only cares about whether the expression changed and
not whether it was written. I realise now their functioning is more
software-like (and even inconsistent with respect to awatch, which you'd
think would be the union of watch and rwatch).

Thanks for the clarification.