Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa/ppc] correctly bias alloca_reg
Date: Tue, 01 Oct 2002 19:58:00 -0000	[thread overview]
Message-ID: <3D9A60C4.1040906@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

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

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1321 bytes --]

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.  */

             reply	other threads:[~2002-10-02  2:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-01 19:58 Andrew Cagney [this message]
2002-10-02  9:18 ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D9A60C4.1040906@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox