Re: [RFC] Wrong hw_watchpoint_used_count? (multiple location watchpoints)

Joel Brobecker
2010-01-08T10:30:12Z

> But this is something only the target knows. There's no way for
> breakpoint.c to know that, unless we introduce an API through which
> breakpoint.c can ask the target to provide that number.

That's what I eventually thought as well... I have relatively little
experience in how GDB is designed to handle watchpoints, but it seemed
that the boundary between the what the target knows and how the core
uses it provide watchpoint support is pretty hard to find... Perhaps,
one day, we'll want to clarify this area of our code.

> Please note, for example, that some watchpoints can actually need
> *zero* bp_locations, because some other watchpoint already watches the
> same address. x86 uses reference counting to not waste hardware
> resources for the same address.

Clever!

Thanks for the feedback.

--
Joel