Re: [PATCH 1/3] Clear non-significant bits of address on memory access

Yao Qi
2017-12-08T15:36:15Z

"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 (齐尧)