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

Ulrich Weigand uweigand@de.ibm.com
Mon Mar 19 14:29:00 GMT 2018


Maciej W. Rozycki wrote:
> 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.

Good point.  I agree it makes sense to change the default here.

Bye,
Ulrich

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



More information about the Gdb-patches mailing list