From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27469 invoked by alias); 29 Jun 2003 20:43:46 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27351 invoked from network); 29 Jun 2003 20:43:42 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 29 Jun 2003 20:43:42 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 995042B5F for ; Sun, 29 Jun 2003 16:43:40 -0400 (EDT) Message-ID: <3EFF4F7C.9060104@redhat.com> Date: Sun, 29 Jun 2003 20:43:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch,rfc,6] Revert to legacy when REGISTER_BYTE Content-Type: multipart/mixed; boundary="------------070401000504070201080702" X-SW-Source: 2003-06/txt/msg00866.txt.bz2 This is a multi-part message in MIME format. --------------070401000504070201080702 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 468 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 --------------070401000504070201080702 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 3198 2003-06-29 Andrew Cagney * 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; --------------070401000504070201080702--