This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 20 Apr 2002 23:25:29 -0400
- Subject: [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;
}