This is the mail archive of the gdb-patches@sources.redhat.com 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]

[rfa/ppc] correctly bias alloca_reg


Hello,

The attached patch fixes the regnum value assigned to alloca_reg so that it is baised by gpr0's regnum value The code was assuming that GPR 32, for instance had a regnum of 31 :-(

It fixes the failure:
gdb.base/call-ar-st.exp: check args of sum_array_print
for the e500.

ok?
Andrew
2002-10-01  Andrew Cagney  <ac131313@redhat.com>

	* rs6000-tdep.c (skip_prologue): Bias alloca_reg by ppc_gp0_regnum.

Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.86
diff -u -r1.86 rs6000-tdep.c
--- rs6000-tdep.c	1 Oct 2002 14:57:55 -0000	1.86
+++ rs6000-tdep.c	2 Oct 2002 02:46:32 -0000
@@ -465,6 +465,7 @@
   int prev_insn_was_prologue_insn = 1;
   int num_skip_non_prologue_insns = 0;
   const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   
   /* Attempt to find the end of the prologue when no limit is specified.
      Note that refine_prologue_limit() has been written so that it may
@@ -694,7 +695,7 @@
 	{			/* mr r31, r1 */
 	  fdata->frameless = 0;
 	  framep = 1;
-	  fdata->alloca_reg = 31;
+	  fdata->alloca_reg = (tdep->ppc_gp0_regnum + 31);
 	  continue;
 
 	  /* Another way to set up the frame pointer.  */
@@ -703,7 +704,8 @@
 	{			/* addi rX, r1, 0x0 */
 	  fdata->frameless = 0;
 	  framep = 1;
-	  fdata->alloca_reg = (op & ~0x38010000) >> 21;
+	  fdata->alloca_reg = (tdep->ppc_gp0_regnum
+			       + ((op & ~0x38010000) >> 21));
 	  continue;
 	}
       /* AltiVec related instructions.  */

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