From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17757 invoked by alias); 11 Dec 2009 19:06:37 -0000 Received: (qmail 17748 invoked by uid 22791); 11 Dec 2009 19:06:37 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Dec 2009 19:06:30 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBBJ67ZH003309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Dec 2009 14:06:07 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBBJ66Rk019615; Fri, 11 Dec 2009 14:06:06 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id nBBJ65wt007953; Fri, 11 Dec 2009 14:06:05 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id D3A653782A3; Fri, 11 Dec 2009 12:06:04 -0700 (MST) From: Tom Tromey To: Hilfinger@adacore.com Cc: gdb-patches@sourceware.org, brobecker@adacore.com Subject: Re: [RFA] 64-bit range types in GDB References: <20091204081343.A8718227B32@nile.gnat.com> <20091205121800.DB060227B32@nile.gnat.com> <20091211100306.4A2A9227B32@nile.gnat.com> Reply-To: Tom Tromey Date: Fri, 11 Dec 2009 19:06:00 -0000 In-Reply-To: <20091211100306.4A2A9227B32@nile.gnat.com> (Paul Hilfinger's message of "Fri, 11 Dec 2009 05:03:06 -0500 (EST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (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: 2009-12/txt/msg00166.txt.bz2 >>>>> "Paul" == Paul Hilfinger writes: Paul> Here is the 64-bit range patch, revised per Tom's suggestions. Paul> For now, I have eliminated the fixup_range_type_hack routine until Paul> such time if ever that I find the failing cases that required Paul> it. (Besides which, I see that the first patch didn't (ahem) Paul> bother to call it anyway). :-) Paul> In check_typedef, I have handled the overflow situation by setting the Paul> array length to 0. I decided against using UINT_MAX given the likely Paul> consequences of having such a value actually used to allocate a value Paul> structure. Thanks. Paul> OK to commit? One nit... Paul> + /* For now, we conservatively take the array length to be 0 Paul> + * if its length exceeds UINT_MAX. The code below assumes Paul> + * that for x < 0, (ULONGEST) x == -x + ULONGEST_MAX + 1, Paul> + * which is technically not guaranteed by C, but is usually true Paul> + * (because it would be true if x were unsigned with its Paul> + * high-order bit on). It uses the fact that Paul> + * high_bound-low_bound is always representable in Paul> + * ULONGEST and that if high_bound-low_bound+1 overflows, Paul> + * it overflows to 0. We must change these tests if we Paul> + * decide to increase the representation of TYPE_LENGTH Paul> + * from unsigned int to ULONGEST. FIXME: pnh/2009-12-07. */ The GNU style is not to put a "*" at the start of each line. Also we currently eschew new FIXME comments. I think you could just remove the FIXME. I personally also am not in favor of putting one's initials in comments -- gdb has several such comments where I have no clue at all who the person might be. Ok with that change. Tom