From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28603 invoked by alias); 2 Mar 2003 10:27:11 -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 28596 invoked from network); 2 Mar 2003 10:27:10 -0000 Received: from unknown (HELO kraid.nerim.net) (62.4.16.102) by 172.16.49.205 with SMTP; 2 Mar 2003 10:27:10 -0000 Received: from nerim.fr (stcarrez.net1.nerim.net [62.212.108.40]) by kraid.nerim.net (Postfix) with ESMTP id E3D9840E2B; Sun, 2 Mar 2003 11:27:08 +0100 (CET) Message-ID: <3E61DC7C.4040805@nerim.fr> Date: Sun, 02 Mar 2003 10:27:00 -0000 From: Stephane Carrez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: en-us MIME-Version: 1.0 To: gdb-patches@sources.redhat.com, ac131313@redhat.com Subject: [PATCH]: Fix generic_register_byte Content-Type: multipart/mixed; boundary="------------000707090009070109010409" X-SW-Source: 2003-03/txt/msg00025.txt.bz2 This is a multi-part message in MIME format. --------------000707090009070109010409 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 669 Hi Andrew, I've committed this patch (obvious fix) to fix a bug in generic_register_byte(). You were using the 'regnum' instead of the loop index and this resulted in a wrong byte position being computed. Ie: reg_num * generic_register_size (reg_num). It didn't show up for you because most targets use a fixed-size register definition (I guess). For HC11, I have 2-byte reg as well as 1-byte reg, so it came up to invalid value, and then aborted in frame_register(). Stephane 2003-03-02 Stephane Carrez * arch-utils.c (generic_register_byte): Fix to use the loop index and not regnum when summing the size of all registers up to regnum. --------------000707090009070109010409 Content-Type: text/plain; name="arch-utils.c.diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="arch-utils.c.diffs" Content-length: 499 Index: arch-utils.c =================================================================== RCS file: /cvs/src/src/gdb/arch-utils.c,v retrieving revision 1.75 diff -u -p -r1.75 arch-utils.c --- arch-utils.c 1 Mar 2003 17:59:12 -0000 1.75 +++ arch-utils.c 2 Mar 2003 10:21:58 -0000 @@ -460,7 +460,7 @@ generic_register_byte (int regnum) byte = 0; for (i = 0; i < regnum; i++) { - byte += generic_register_size (regnum); + byte += generic_register_size (i); } return byte; } --------------000707090009070109010409--