This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdbarch: Add pc_signed field and use it when adjusting BP addresses


Vlad Ivanov wrote:
> 15.03.2018, 15:59, "Ulrich Weigand" <uweigand@de.ibm.com>:
> > If the address is already correct, why don't you simply set
> > gdbarch_significant_addr_bit
> > to 64 in the mips back-end instead of adding a new gdbarch routine?
> 
> That would affect address printing.

I don't see how it can affect address printing.  gdbarch_significant_addr_bit
is not involved in that at all.

> Moreover, semantically it's 
> probably not a good practice because the code would imply that for 
> all kind of MIPS all 64 bits of address are significant, whereas
> in reality it differs from target to target.

Well, all 64 bits *are* significant in the relevant sense here.
"Significant" here only means, the bit already has the correct value
that it needs to have if you want to access the intended memory word
via ptrace.

The only reason to ever set gdbarch_significant_addr_bit to anything
less than the host word size is if addresses contain some tags or
other extraneous bits that actively need to be trimmed.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]