This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] Clear non-significant bits of address on memory access
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: palves at redhat dot com (Pedro Alves), gdb-patches at sourceware dot org
- Date: Fri, 08 Dec 2017 15:36:06 +0000
- Subject: Re: [PATCH 1/3] Clear non-significant bits of address on memory access
- Authentication-results: sourceware.org; auth=none
- References: <20171208151322.30013D8048A@oc3748833570.ibm.com>
"Ulrich Weigand" <uweigand@de.ibm.com> writes:
> This seems to duplicate the functionality of gdbarch_addr_bits_remove
> to some extent ... Could those be merged back again?
They are a little bit different, addr_bits_remove only applies to PC (for
arm and mips), but significant_addr_bit applies to every address (both
data and instruction). On the other hand, the LSB of address in arm and
mips is still significant, but it has some different meaning other than
address when it is the target address of branch. We only clear the LSB
when it is the target address. In normal memory access, watchpoing
setting, we don't clear it.
Simon asked the same question, see
https://sourceware.org/ml/gdb-patches/2017-11/msg00213.html
These two gdbarch methods are quite similar, but difficult to merge
these two, unless we bring more context in the gdbarch hook method.
--
Yao (齐尧)