Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init()
@ 2002-04-20 20:25 Andrew Cagney
  2002-04-22  4:08 ` Richard Earnshaw
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2002-04-20 20:25 UTC (permalink / raw)
  To: gdb-patches

[-- 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;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-04-24 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-20 20:25 [patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init() Andrew Cagney
2002-04-22  4:08 ` Richard Earnshaw
2002-04-22  6:59   ` Andrew Cagney
2002-04-24 11:23   ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox