From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [patch,rfc,6] Revert to legacy when REGISTER_BYTE
Date: Sun, 29 Jun 2003 20:43:00 -0000 [thread overview]
Message-ID: <3EFF4F7C.9060104@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
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
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 3198 bytes --]
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;
next reply other threads:[~2003-06-29 20:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-29 20:43 Andrew Cagney [this message]
2003-06-29 21:01 ` Daniel Jacobowitz
2003-07-01 21:39 ` Andrew Cagney
2003-07-03 14:52 ` 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=3EFF4F7C.9060104@redhat.com \
--to=ac131313@redhat.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