This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch,rfc,6] Revert to legacy when REGISTER_BYTE
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 29 Jun 2003 16:43:40 -0400
- Subject: [patch,rfc,6] Revert to legacy when REGISTER_BYTE
Sigh,
This patch changes the regcache so that, when REGISTER_BYTE or
REGISTER_RAW_SIZE are present, the old style legacy regcache layout is used.
This will stop those regcache assertion failures. Fixing the problem
(especially for MIPS) will just get too messy for the branch :-(
My thought is to commit this to 6.0 branch, while on the mainline delete
REGISTER_BYTE and REGISTER_RAW_SIZE and just wear the consequences ...
comments and/or suggestions?
Andrew
2003-06-29 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE): Add
predicate.
* gdbarch.h, gdbarch.c: Re-generate.
* regcache.c (init_regcache_descr): Use legacy code when either
REGISTER_BYTE or REGISTER_RAW_SIZE is set.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.253
diff -u -r1.253 gdbarch.sh
--- gdbarch.sh 26 Jun 2003 17:18:42 -0000 1.253
+++ gdbarch.sh 29 Jun 2003 20:27:51 -0000
@@ -486,12 +486,12 @@
# sizes agree with the value computed from REGISTER_TYPE,
# DEPRECATED_REGISTER_RAW_SIZE can be deleted. See: maint print
# registers.
-f:2:REGISTER_RAW_SIZE:int:deprecated_register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
+F:2:REGISTER_RAW_SIZE:int:deprecated_register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
# If all registers have identical raw and virtual sizes and those
# sizes agree with the value computed from REGISTER_TYPE,
# DEPRECATED_REGISTER_VIRTUAL_SIZE can be deleted. See: maint print
# registers.
-f:2:REGISTER_VIRTUAL_SIZE:int:deprecated_register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
+F:2:REGISTER_VIRTUAL_SIZE:int:deprecated_register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
# DEPRECATED_MAX_REGISTER_RAW_SIZE can be deleted. It has been
# replaced by the constant MAX_REGISTER_SIZE.
V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.88
diff -u -r1.88 regcache.c
--- regcache.c 16 Jun 2003 13:19:36 -0000 1.88
+++ regcache.c 29 Jun 2003 20:28:07 -0000
@@ -178,16 +178,17 @@
/* If an old style architecture, fill in the remainder of the
register cache descriptor using the register macros. */
- if (!gdbarch_pseudo_register_read_p (gdbarch)
- && !gdbarch_pseudo_register_write_p (gdbarch)
- && !gdbarch_register_type_p (gdbarch))
+ /* NOTE: cagney/2003-06-29: If either of REGISTER_BYTE or
+ REGISTER_RAW_SIZE are still present, things are most likely
+ totally screwed. Ex: an architecture with raw register sizes
+ smaller than what REGISTER_BYTE indicates; non monotonic
+ REGISTER_BYTE values. For GDB 6 check for these nasty methods
+ and fall back to legacy code when present. Sigh! */
+ if ((!gdbarch_pseudo_register_read_p (gdbarch)
+ && !gdbarch_pseudo_register_write_p (gdbarch)
+ && !gdbarch_register_type_p (gdbarch))
+ || REGISTER_BYTE_P () || REGISTER_RAW_SIZE_P ())
{
- /* NOTE: cagney/2003-05-02: Don't add a test for REGISTER_BYTE_P
- to the above. Doing that would cause all the existing
- architectures to revert back to the legacy regcache
- mechanisms, and that is not a good thing. Instead just,
- later, check that the register cache's layout is consistent
- with REGISTER_BYTE. */
descr->legacy_p = 1;
init_legacy_regcache_descr (gdbarch, descr);
return descr;