From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14195 invoked by alias); 14 Dec 2010 05:42:10 -0000 Received: (qmail 14158 invoked by uid 22791); 14 Dec 2010 05:42:09 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Dec 2010 05:42:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1EDF62BAB6B; Tue, 14 Dec 2010 00:42:03 -0500 (EST) 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 O3-a37ztdO2J; Tue, 14 Dec 2010 00:42:03 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A3E672BAB69; Tue, 14 Dec 2010 00:42:02 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 73ACC145B58; Tue, 14 Dec 2010 06:41:50 +0100 (CET) Date: Tue, 14 Dec 2010 05:42:00 -0000 From: Joel Brobecker To: Ken Werner Cc: gdb-patches@sourceware.org, Tom Tromey Subject: Re: [patch] DW_AT_byte_size for array type entries Message-ID: <20101214054150.GJ2596@adacore.com> References: <201010191323.57251.ken@linux.vnet.ibm.com> <201011031522.50715.ken@linux.vnet.ibm.com> <201012132103.09320.ken@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012132103.09320.ken@linux.vnet.ibm.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-12/txt/msg00207.txt.bz2 > 2010-12-13 Ken Werner > > * valops.c (value_one): Use get_array_bounds to compute the number > of array elements instead of dividing the length of the array by the > length of the element types. > * valarith.c (value_complement, value_neg): Likewise. This is OK. As a followup patch, how about defining a new function `get_array_length' next to get_array_bounds? That way, you can factorize of this code that keeps being repeated... -- Joel