From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26982 invoked by alias); 26 Nov 2008 16:55:13 -0000 Received: (qmail 26971 invoked by uid 22791); 26 Nov 2008 16:55:12 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Nov 2008 16:54:33 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mAQGs9ec008240; Wed, 26 Nov 2008 11:54:09 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mAQGs80K012284; Wed, 26 Nov 2008 11:54:08 -0500 Received: from opsy.redhat.com (vpn-13-70.rdu.redhat.com [10.11.13.70]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mAQGs7r7000698; Wed, 26 Nov 2008 11:54:07 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 7AB0A482B4; Wed, 26 Nov 2008 09:54:06 -0700 (MST) To: Joel Brobecker Cc: Jie Zhang , gdb-patches@sourceware.org Subject: Re: PING: [PATCH] Fix a bug of addrmap References: <48FD5DE1.9090105@analog.com> <490E9540.7000207@analog.com> <20081125174613.GF3946@adacore.com> From: Tom Tromey Reply-To: Tom Tromey Date: Thu, 27 Nov 2008 14:45:00 -0000 In-Reply-To: <20081125174613.GF3946@adacore.com> (Joel Brobecker's message of "Tue\, 25 Nov 2008 09\:46\:13 -0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2008-11/txt/msg00718.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> Did you familiarize yourself with the code that you'd say that Joel> the patch sounds good to you? I looked at it again today. I re-read the contract for this function, and it seems pretty clear that the current behavior is intended: /* In the mutable address map MAP, associate the addresses from START to END_INCLUSIVE that are currently associated with NULL with OBJ instead. Addresses mapped to an object other than NULL are left unchanged. In particular, "currently associated with NULL" is the key. My understanding now is that this data structure is designed to be built bottom-up. So, I think that this is a bug in the caller, and that the test I wrote is actually not correct. Of course, it would be ok to change addrmap's contract. But, if we want to do this then I think we would need more tests covering other corner cases. BTW, addrmap is nice code. It has all the hallmarks of the Blandy style. Tom