This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] aarch64: PR 19806: watchpoints: false negatives -> false positives
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 7 Jun 2016 14:41:02 +0100
- Subject: Re: [patch] aarch64: PR 19806: watchpoints: false negatives -> false positives
- Authentication-results: sourceware.org; auth=none
- References: <20160606075945 dot GA19395 at host1 dot jankratochvil dot net> <86eg89w2sr dot fsf at gmail dot com>
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