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: "Maciej W. Rozycki" <macro at mips dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Yao Qi <yao dot qi at linaro dot org>, Vlad Ivanov <vlad dot ivanov at lab-systems dot ru>, Andreas Schwab <schwab at suse dot de>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 19 Mar 2018 14:08:44 +0000
- Subject: Re: [PATCH] gdbarch: Add pc_signed field and use it when adjusting BP addresses
- References: <20180315125901.CE510D804A7@oc3748833570.ibm.com>
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