From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7593 invoked by alias); 2 Nov 2010 08:23:28 -0000 Received: (qmail 7582 invoked by uid 22791); 2 Nov 2010 08:23:27 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate1.uk.ibm.com (HELO mtagate1.uk.ibm.com) (194.196.100.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Nov 2010 08:23:18 +0000 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id oA28NFWX010730 for ; Tue, 2 Nov 2010 08:23:15 GMT Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oA28NHsC3293230 for ; Tue, 2 Nov 2010 08:23:17 GMT Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oA28NFCu028403 for ; Tue, 2 Nov 2010 02:23:15 -0600 Received: from leonard.localnet (dyn-9-152-224-33.boeblingen.de.ibm.com [9.152.224.33]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id oA28NC0H028375 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Nov 2010 02:23:15 -0600 From: Ken Werner To: gdb-patches@sourceware.org Subject: Re: [patch] DW_AT_byte_size for array type entries Date: Tue, 02 Nov 2010 08:23:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-22-generic-pae; KDE/4.5.1; i686; ; ) References: <201010191323.57251.ken@linux.vnet.ibm.com> <201010192016.05535.ken@linux.vnet.ibm.com> In-Reply-To: <201010192016.05535.ken@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201011020923.11875.ken@linux.vnet.ibm.com> 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: 2010-11/txt/msg00017.txt.bz2 On Tuesday, October 19, 2010 8:16:05 pm Ken Werner wrote: > On Tuesday, October 19, 2010 1:23:57 pm Ken Werner wrote: > > Hi, > > > > Section 5.4 of the DWARF standard allows to specify extra padding bytes > > for array type entries by using the DW_AT_byte_size attribute. This is > > used for example to specify the types for OpenCL 3-component vectors > > whose size and alignment are those of 4-component vectors. Currently the > > GDB does not understand this mechanism and the attached patch attempts > > to fix this. It extends the DWARF reader (dwarf2read.c:read_array_type) > > to respect the DW_AT_byte_size attribute and set the length of the array > > accordingly. This breaks the code that assumes that the number of > > elements of an array is simply the length of the array type divided by > > the length of the element type. Therefore the patch queries the number > > of array elements using the get_array_bounds function that has been > > enhanced to only return the bounds if they are defined > > (TYPE_ARRAY_[LOWER|UPPER]_BOUND_IS_UNDEFINED). In order to prevent the > > inclusion of the valprint.h header the > > get_array_bounds function has been moved from valprint.[c|h] to > > gdbtypes.[c|h]. > > Tested on i686-*-linux-gnu with no regressions. > > Hm, that patch lacks the chunk that changes the c_type_print_varspec_suffix > function. Here is the full version. Any objections/comments on that patch? Thanks Ken