This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdbarch: Add pc_signed field and use it when adjusting BP addresses
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: macro at mips dot com (Maciej W. Rozycki)
- Cc: yao dot qi at linaro dot org (Yao Qi), vlad dot ivanov at lab-systems dot ru (Vlad Ivanov), schwab at suse dot de (Andreas Schwab), gdb-patches at sourceware dot org (gdb-patches at sourceware dot org)
- Date: Mon, 19 Mar 2018 15:29:00 +0100 (CET)
- Subject: Re: [PATCH] gdbarch: Add pc_signed field and use it when adjusting BP addresses
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