This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix for gdb.base/pc-fp.exp.
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: cel at us dot ibm dot com (Carl E. Love)
- Cc: palves at redhat dot com (Pedro Alves), Ulrich dot Weigand at de dot ibm dot com (Ulrich Weigand), emachado at linux dot vnet dot ibm dot com (Edjunior Barbosa Machado), gdb-patches at sourceware dot org
- Date: Tue, 23 Aug 2016 18:30:23 +0200 (CEST)
- Subject: Re: [PATCH] Fix for gdb.base/pc-fp.exp.
- Authentication-results: sourceware.org; auth=none
Carl Love wrote:
> That said, the code "set_gdbarch_deprecated_fp_regnum
> (gdbarch, PPC_R0_REGNUM + 1);" sets up register r1 as the frame pointer.
> Register r1 is no longer used to hold the frame pointer on Power. By
> removing the fp definition for Power in GDB, it causes GDB to fall back
> to the call get_frame_base_address (frame) which returns the correct value
> depending on the specific senario but most of the time is the DWARF
> canonical frame address.
That's true. In fact, the one place that really cares about the value
returned via $fp is varobj.c:find_frame_addr_in_frame_chain, since you're
supposed to use the value of $fp to identify a frame for MI routines.
And there we explicitly assume that this value matches the value returned
by get_frame_base_address.
> 2016-08-22 Carl Love <cel@us.ibm.com>
>
> * rs6000-tdep.c (rs6000_gdbarch_init): Remove deprecated call set_gdbarch_deprecated_fp_regnum()
> from Power architecture initialization function.
Please watch the 80-char line length limit, which holds for the ChangeLog
as well. In fact, the text can be shortened anyway: "deprecated" is
redundant (included in the function name), and likewise is "from Power
architecture initialization function" (you already specified which
function --rs6000_gdbarch_init-- you're modifying). I'd suggest:
* rs6000-tdep.c (rs6000_gdbarch_init): Remove call to
set_gdbarch_deprecated_fp_regnum.
Patch is OK.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com