From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15518 invoked by alias); 17 May 2010 15:43:20 -0000 Received: (qmail 15508 invoked by uid 22791); 17 May 2010 15:43:18 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 May 2010 15:43:14 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o4HFhB4o025186 for ; Mon, 17 May 2010 17:43:11 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o4HFhA1x026740 for ; Mon, 17 May 2010 17:43:10 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o4HFh8Du014676 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 17 May 2010 17:43:10 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFA] handle DW_AT_byte_size for set types Date: Mon, 17 May 2010 15:47:00 -0000 Message-ID: <000301caf5d7$ab26f030$0174d090$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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-05/txt/msg00345.txt.bz2 According to Dwarf 2.0.0 page 46, DW_TAG_set_type supports DW_AT_byte_size attribute, but this is not implemented yet inside GDB. The patch below implements this, it will allow to correctly give the value of constant pascal sets (at least for Free Pascal compiler). The patch is rather obvious... Is this OK? Pierre Muller Pascal language support maintainer for GDB 2010-05-17 Pierre Muller * dwarf2read.c (read_set_type): Set type length if DW_AT_byte_size attribute is present. Index: src/gdb/dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.385 diff -u -p -r1.385 dwarf2read.c --- src/gdb/dwarf2read.c 14 May 2010 17:53:16 -0000 1.385 +++ src/gdb/dwarf2read.c 17 May 2010 15:33:17 -0000 @@ -5547,7 +5556,10 @@ static struct type * read_set_type (struct die_info *die, struct dwarf2_cu *cu) { struct type *set_type = create_set_type (NULL, die_type (die, cu)); + struct attribute *attr = dwarf2_attr (die, DW_AT_byte_size, cu); + if (attr) + TYPE_LENGTH(set_type) = DW_UNSND (attr); return set_die_type (die, set_type, cu); }