From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29643 invoked by alias); 15 May 2002 16:52:57 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 29577 invoked from network); 15 May 2002 16:52:56 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 15 May 2002 16:52:56 -0000 Received: by fw-cam.cambridge.arm.com; id RAA25033; Wed, 15 May 2002 17:52:53 +0100 (BST) Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma024873; Wed, 15 May 02 17:52:37 +0100 Received: from cam-mail2.cambridge.arm.com (cam-mail2.cambridge.arm.com [172.16.1.91]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id RAA00089 for ; Wed, 15 May 2002 17:52:37 +0100 (BST) Received: from sun18.cambridge.arm.com (sun18.cambridge.arm.com [172.16.2.18]) by cam-mail2.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id RAA12242; Wed, 15 May 2002 17:52:36 +0100 (BST) Message-Id: <200205151652.RAA12242@cam-mail2.cambridge.arm.com> To: gdb@sources.redhat.com cc: Richard.Earnshaw@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. X-Url: http://www.arm.com/ Subject: read_register_byte can't work with pseudo-reg model Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 15 May 2002 09:52:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-05/txt/msg00167.txt.bz2 Given the following code in read_register_byte: reg_start = REGISTER_BYTE (regnum); reg_len = REGISTER_RAW_SIZE (regnum); reg_end = reg_start + reg_len; if (reg_end <= in_start || in_end <= reg_start) /* The range the user wants to read doesn't overlap with regnum. */ continue; if (REGISTER_NAME (regnum) != NULL && *REGISTER_NAME (regnum) != '\0') /* Force the cache to fetch the entire register. */ read_register_gen (regnum, reg_buf); else /* Legacy note: even though this register is ``invalid'' we still need to return something. It would appear that some code relies on apparent gaps in the register array also being returned. */ /* FIXME: cagney/2001-08-18: This is just silly. It defeats the entire register read/write flow of control. Must resist temptation to return 0xdeadbeef. */ memcpy (reg_buf, registers + reg_start, reg_len); Then the new model of having all named registers be pseudos will never re-read the registers, because all registers with an entry in registers[] will not have a name. Shouldn't the "REGISTER_NAME" check be a direct check for register_cached(regno) == 0 That would mean that we could change the above to be something like reg_start = REGISTER_BYTE (regnum); reg_len = REGISTER_RAW_SIZE (regnum); reg_end = reg_start + reg_len; if (reg_end <= in_start || in_end <= reg_start) /* The range the user wants to read doesn't overlap with regnum. */ continue; if (register_cached (regnum) == 0) /* Force the cache to fetch the entire register. */ legacy_read_register_gen (regnum, reg_buf); else /* Legacy note: even though this register is ``invalid'' we still need to return something. It would appear that some code relies on apparent gaps in the register array also being returned. */ /* FIXME: cagney/2001-08-18: This is just silly. It defeats the entire register read/write flow of control. Must resist temptation to return 0xdeadbeef. */ memcpy (reg_buf, registers + reg_start, reg_len); Though I'm still not sure what we should do for a pseudo with no entry in the cache. R.