From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16076 invoked by alias); 5 Sep 2008 18:08:04 -0000 Received: (qmail 15871 invoked by uid 22791); 5 Sep 2008 18:08:03 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 05 Sep 2008 18:07:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0A8DF2A96E2; Fri, 5 Sep 2008 14:07:22 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9WWWlVnHXWXd; Fri, 5 Sep 2008 14:07:21 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C9B7D2A96CA; Fri, 5 Sep 2008 14:07:21 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id AFA64E7ACD; Fri, 5 Sep 2008 20:07:19 +0200 (CEST) Date: Fri, 05 Sep 2008 18:08:00 -0000 From: Joel Brobecker To: uweigand@de.ibm.com Cc: gdb-patches@sourceware.org Subject: Re: [rfc][05/37] Eliminate builtin_type_ macros: Replace LA_BOOL_TYPE macro Message-ID: <20080905180719.GA15267@adacore.com> References: <20080831175045.128504000@de.ibm.com> <20080831175119.299740000@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080831175119.299740000@de.ibm.com> User-Agent: Mutt/1.4.2.2i 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-09/txt/msg00102.txt.bz2 > * language.c (lang_bool_type): Remove. > (language_bool_type): New function. I was hoping we could cache the boolean type, but I guess it can get stale every time we load or unload a symbol file... > case TYPE_CODE_RANGE: > arg2 = value_from_longest (builtin_type_int, TYPE_LOW_BOUND (type)); > arg3 = value_from_longest (builtin_type_int, > TYPE_HIGH_BOUND (type)); > + type = language_bool_type (exp->language_defn, exp->gdbarch); > return > - value_from_longest (builtin_type_int, > + value_from_longest (type, > (value_less (arg1, arg3) > || value_equal (arg1, arg3)) > && (value_less (arg2, arg1) Nice improvement - the returning of a boolean type instead of an int :). It should transform: (gdb) print 2 in 1 .. 3 $1 = 1 Hopefully into:` (gdb) print 2 in 1 .. 3 $1 = true Thanks! Your patch also allowed me to notice something else: I also think that I'll explore the idea of using value_in() instead of the combination of value_less/value_equal/[...]. Separate patch, though. No further comment, your honor... -- Joel