From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8868 invoked by alias); 2 Aug 2012 08:10:25 -0000 Received: (qmail 8842 invoked by uid 22791); 2 Aug 2012 08:10:21 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_XF X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Aug 2012 08:10:08 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SwqTv-0001Hn-TD from Yao_Qi@mentor.com ; Thu, 02 Aug 2012 01:10:07 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 2 Aug 2012 01:10:07 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Thu, 2 Aug 2012 01:10:06 -0700 From: Yao Qi To: CC: Wei-cheng Wang Subject: Re: [PATCH] Fix memory-region overlapping checking Date: Thu, 02 Aug 2012 08:10:00 -0000 Message-ID: <3341505.ZtLsQODebp@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00054.txt.bz2 On Thursday, August 02, 2012 02:10:40 PM Wei-cheng Wang wrote: > Hi, >=20 > After adding a memory-region with as max CORE_ADDR+1, > no more memory-region can be added. It always complains about > "overlapping" Thanks for reporting this problem, and drafting a patch to fix it. >=20 > For example, >=20 > (gdb) mem 0x50 0x80 ro > (gdb) mem 0xffffff00 0x100000000 ro However, the real problem is that we don't do range checking for inputs in= =20 command 'mem'. The expected behavior is, on a 32-bit target, when user typ= es=20 0x100000000, gdb should emit an error saying that it is out of the range of= =20 CORE_ADDR, or something like that. > (gdb) info mem > Using user-defined memory regions. > Num Enb Low Addr High Addr Attrs > 1 y 0x00000050 0x00000080 ro nocache > 2 y 0xffffff00 0x100000000 ro nocache > (gdb) mem 0x100 0x200 ro > overlapping memory region >=20 > When checking whether the new memory-region includes a previous one, > it should take care special case, where hi =3D=3D 0 means max CORE_ADD= R+1. The case you gave works well on my x86_64-linux. --=20 Yao (=E9=BD=90=E5=B0=A7)