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


On Thu, 15 Mar 2018, Ulrich Weigand wrote:

> > MIPS backend already returns a sign-extended value, and address_significant 
> > cuts out bits 63 to 32. This makes breakpoint address comparison in step 
> > routines to misbehave.
> 
> 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?

 I think it's the default from commit a738ea1d41da ("Clear non-significant 
bits of address on memory access") that is wrong.  The default is set to 
`gdbarch_addr_bit (gdbarch)'.  Instead I think it should be set to the BFD 
VMA width, i.e. `8 * sizeof (bfd_vma)' or suchlike, so that the internal 
representation does not get truncated inadvertently.

 More targets will be affected; e.g. as I recall SH also has signed 
addresses.

  Maciej


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