This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] [AArch64] Remove tag from address for watchpoint
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 9 Nov 2017 22:25:51 +0000
- Subject: Re: [PATCH 3/3] [AArch64] Remove tag from address for watchpoint
- Authentication-results: sourceware.org; auth=none
- References: <1509006590-9401-1-git-send-email-yao.qi@linaro.org> <1509006590-9401-4-git-send-email-yao.qi@linaro.org> <2fe62186-f1db-cf5c-f0e2-c18e35089dd9@redhat.com> <20171109210950.GD318@1170ee0b50d5>
On 11/09/2017 09:09 PM, Yao Qi wrote:
> On 17-11-09 20:30:42, Pedro Alves wrote:
>> And then at places where we need to save or compare memory addresses,
>> like in the watchpoint location addresses case we strip out / ignore
>> non-significant bits.
>>
>> And the next question is: if you're adding a gdbarch hook such as
>> this one (either significant_addr_bit or addr_tag_remove)
>> why not use it for all the cases handled by the different patches in
>> this series, instead of using different solutions for each case?
>> I.e., for memory access, saving breakpoint and watchpoint
>> location addresses, the dcache, and any other future case we run
>> into, like e.g., maybe agent expressions.
>
> I thought about this, using this new added gdbarch method everywhere.
> The reason I didn't do that is due to breakpoint location address
> comparison (I think I can use the new gdbarch method for the rest,
> watchpoint location and dcache).
>
> As I wrote in patch #2,
>
>> When program hits a breakpoint, the stopped pc reported by Linux kernle is
>> the address *without* tag, so it is better the address recorded in
>> breakpoint location is the one without tag too, so we can still match
>> breakpoint location address and stopped pc reported by Linux kernel, by
>> simple compare. I did try the different approach, that is keep the tag in
>> the address saved in the breakpoint location, but I need to change many
>> places of "loc->address == pc", so I give up on this way.
>
> I remember code pattern "loc->address == pc" exists many places in
> breakpoint.c. I can give a try again.
Since target-reported addresses always have the non-significant bits
zeroed, you'd only need to use the new gdbarch hook in
breakpoint.c:adjust_breakpoint_address ? Seems like that's already
used for watchpoints too, even.
Thanks,
Pedro Alves