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]

[patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init()


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

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