From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28273 invoked by alias); 13 Feb 2003 23:58:27 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 28266 invoked from network); 13 Feb 2003 23:58:27 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 13 Feb 2003 23:58:27 -0000 Received: from redhat.com (topaz.toronto.redhat.com [172.16.14.227]) by touchme.toronto.redhat.com (Postfix) with ESMTP id DF47D80004E for ; Thu, 13 Feb 2003 18:58:26 -0500 (EST) Message-ID: <3E4C3122.5040409@redhat.com> Date: Thu, 13 Feb 2003 23:58:00 -0000 From: Dave Brolley Organization: Red Hat Canada, Ltd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021216 X-Accept-Language: en-us, en MIME-Version: 1.0 To: sid@sources.redhat.com Subject: [patch][rfa]: SID mapper component - wordsize Content-Type: multipart/mixed; boundary="------------070701090906040303020007" X-SW-Source: 2003-q1/txt/msg00046.txt.bz2 This is a multi-part message in MIME format. --------------070701090906040303020007 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 649 Hi, I ran across a problem with the scaling of the upper bound of a mapped range when the wordsize feature is used. The specification [4*1000-1010] should allow access to the range 4000-4043, however, the upper bound is simply being multiplied by the wordsize, resulting in an upper bound of 4040. If the mapper is accessed using wordsized elements, the problem goes unnoticed, since the mapper does not check the ending address of the range being accessed. However, if the mapper is accessed one byte at a time (as GDB often does), the final 3 bytes are considered unmapped. Attached is the patch which corrects this. OK to commit? Dave --------------070701090906040303020007 Content-Type: text/plain; name="mapper-wordsize.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mapper-wordsize.patch.txt" Content-length: 1511 Index: component/mapper/compMapper.cxx =================================================================== RCS file: /cvs/src/src/sid/component/mapper/compMapper.cxx,v retrieving revision 1.12 diff -c -p -r1.12 compMapper.cxx *** component/mapper/compMapper.cxx 11 Nov 2002 22:28:28 -0000 1.12 --- component/mapper/compMapper.cxx 13 Feb 2003 23:49:05 -0000 *************** *** 1,6 **** // compMapper.cxx - a bus mapper component. -*- C++ -*- ! // Copyright (C) 1999-2002 Red Hat. // This file is part of SID and is licensed under the GPL. // See the file COPYING.SID for conditions for redistribution. --- 1,6 ---- // compMapper.cxx - a bus mapper component. -*- C++ -*- ! // Copyright (C) 1999-2003 Red Hat. // This file is part of SID and is licensed under the GPL. // See the file COPYING.SID for conditions for redistribution. *************** generic_mapper::make_name_mapping (const *** 774,780 **** // scale all values by the word width record.mapped_base *= record.bytes_per_word; record.low *= record.bytes_per_word; ! record.high *= record.bytes_per_word; record.stride *= record.bytes_per_word; record.width *= record.bytes_per_word; --- 774,780 ---- // scale all values by the word width record.mapped_base *= record.bytes_per_word; record.low *= record.bytes_per_word; ! record.high = (record.high + 1) * record.bytes_per_word - 1; record.stride *= record.bytes_per_word; record.width *= record.bytes_per_word; --------------070701090906040303020007--