Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: [patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init()
Date: Sat, 20 Apr 2002 20:25:00 -0000	[thread overview]
Message-ID: <3CC23129.3080700@cygnus.com> (raw)

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

Hello,

The macro NUM_PSEUDO_REGS refers to ``current_gdbarch'' and not 
``gdbarch''.  Hence the equation in the patch was picking up the number 
of pseudo-registers from the previously selected architecture (which may 
not even be ARM), outch!  No wonder macro's are bad :-)

The attached calls gdbarch_num_pseudo_regs() directly with the correct 
architecture.  (It also fixes a core dump that my next patch will cause ...)

Committed as fairly obvious.

Andrew

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

2002-04-20  Andrew Cagney  <ac131313@redhat.com>

	* arm-tdep.c (arm_gdbarch_init): Use gdbarch_num_pseudo_regs
	instead of NUM_PSEUDO_REGS.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.48
diff -u -r1.48 arm-tdep.c
--- arm-tdep.c	19 Feb 2002 19:20:31 -0000	1.48
+++ arm-tdep.c	21 Apr 2002 03:15:38 -0000
@@ -3015,7 +3015,8 @@
 
   prologue_cache.saved_regs = (CORE_ADDR *)
     xcalloc (1, (sizeof (CORE_ADDR)
-		 * (gdbarch_num_regs (gdbarch) + NUM_PSEUDO_REGS)));
+		 * (gdbarch_num_regs (gdbarch)
+		    + gdbarch_num_pseudo_regs (gdbarch))));
 
   return gdbarch;
 }

             reply	other threads:[~2002-04-21  3:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-20 20:25 Andrew Cagney [this message]
2002-04-22  4:08 ` Richard Earnshaw
2002-04-22  6:59   ` Andrew Cagney
2002-04-24 11:23   ` Andrew Cagney

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=3CC23129.3080700@cygnus.com \
    --to=ac131313@cygnus.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