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: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 10 Jun 2016 09:11:38 +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> <48622de4-dc45-c48f-7172-495b669f2334 at redhat dot com> <86a8ixvx5k dot fsf at gmail dot com> <7fabd183-eb46-e916-77f2-f62d5c4e4ce7 at redhat dot com> <86oa7bvdi0 dot fsf at gmail dot com> <4f4d2f70-3931-6467-37c7-f97f99ad5c63 at redhat dot com> <380b5288-f46f-3e20-c9c3-8cc8738ee322 at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
> So I'm now thinking that the best is to extend the RSP somehow.
>
I think it is a good idea to extend the RSP...
> I think that my preference is for the target to report a
> memory range instead of a single address in the watchpoint
> stop reply. Like, e.g., if an access to address 10000006 triggers,
> but all the target knows is that some address between 10000004
> and 10000008 was accessed, it reports:
>
> T05 watch:10000004-10000008
>
> instead of:
>
> T05 watch:10000006
>
> ( or maybe T05 watch:10000004;watch-end:10000008 )
>
> This should be easy to implement in the target side, and
> is practically stateless (a stub that just forwards requests
> to a lower level debug api doesn't have to remember
> the addresses gdb requested).
>
Right.
> Then the corresponding target methods in gdb would work with an
> address range instead of a single address too. E.g.,
> target_watchpoint_addr_within_range would be replaced by
> a range overlap check.
>
> If the target knows the process stopped for a watchpoint, but
> doesn't know the address that triggered, then it could report
> the whole address space as range:
>
> T05 watch:00000000-ffffffff
>
> Note that it's not possible currently for a remote stub to tell gdb
> that it doesn't know the address that trapped, even though the
> target_ops:target_stopped_data_address method supports
> returning false, and some native targets do make use of it.
>
> Alternatively, since we're extending the packet anyway, we
> can make the address optional, thus making these equivalent:
>
> T05 watch:00000000-ffffffff
> T05 watch:
I prefer the latter, T05 watch:.
> Alternatively, I though we could add a new qSupported feature value
> that informs gdb of what is the watchpoint alignment and size
> restriction, but I'm not so keen on that since the alignment
> restriction may depend on mode (e.g., 32-bit vs 64-bit inferior),
> or on the size of the area being watched, or some more complicated rule.
Yes, there are different watchpoint alignment restrictions on arm and
aarch64.
--
Yao (éå)