Re: [patch] aarch64: PR 19806: watchpoints: false negatives -> false positives

Pedro Alves
2016-06-07T13:41:25Z

On 06/07/2016 02:23 PM, Yao Qi wrote:

> this leads me thinking that why do we need to get "inaccurate address"
> from target_stopped_data_address, and pass it to
> target_watchpoint_addr_within_range. Instead, we can pass the
> watchpoint to the (new) target hook, and set
> watchpoint.watchpoint_triggered in different target implementations. In
> each target implementation, we can set .watchpoint_triggered to
> watch_triggered_{yes,no,unknown} according to its hardware feature or
> capability.
>
> I'll give a try this way.

How do you plan on handling remote targets though? Done that way, it
sounds to me like the alignment restrictions should either be a gdbarch
property, or you need some RSP extension, e.g., extend the "watch" stop
reply to indicate an stop data address range instead of a sole address,
or make the stub report back the alignment restriction when GDB tells it
to insert the watchpoint in the first place, instead of just saying "OK".

A gdbarch method poses problems for remote stubs that are actually emulators,
and thus can support hardware watchpoints without these restrictions.
I think it's actually problematic for real machines, as the restrictions
will often depend on process revisions/models. So a gdbarch approach
would be undesirable, IMO.

An RSP extension approach would work, though exactly because it
needs some extension, I'm not sure is worth it.

See:

https://sourceware.org/bugzilla/show_bug.cgi?id=19806#c1

Thanks,
Pedro Alves