Re: read watchpoints don't work on targets that support read watchpoints

Eli Zaretskii
2010-02-22T21:12:18Z

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Mon, 22 Feb 2010 20:09:39 +0000
>
> > > + /* Exact match not required. Within range
> > > + is sufficient. */
> > > + for (loc = b->loc; loc; loc = loc->next)
> > > + if (target_watchpoint_addr_within_range
> > > + (&current_target,
> > > + addr,
> > > + loc->address,
> > > + loc->length))
> >
> > And why are we checking watchpoints that couldn't have triggered,
> > because they watch a different, albeit close, address? What would be
> > the use-case where such a watchpoint could be relevant to deciding
> > which watchpoint to announce?
>
> I'm not sure I understand this question. Does the confusion arise from
> the comment quoted above? This is the exact same check
> watchpoints_triggered does. ADDR is checked for being in
> the [loc->address, loc->address+loc->length) range. If it is, then
> watchpoint B is watching ADDR.
>
> Does this answer your questions?

Yes. I forgot that target_stopped_data_address can return an address
that is anywhere within the watched region. Sorry, too many years
have passed.