From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5870 invoked by alias); 18 Jul 2011 15:17:11 -0000 Received: (qmail 5861 invoked by uid 22791); 18 Jul 2011 15:17:10 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_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; Mon, 18 Jul 2011 15:16:56 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6IFGumq029856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 18 Jul 2011 11:16:56 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6IFGt1w007023; Mon, 18 Jul 2011 11:16:55 -0400 Received: from barimba (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 p6IFGsek013706; Mon, 18 Jul 2011 11:16:54 -0400 From: Tom Tromey To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [4/4] RFC: dynamic arrays and DW_FORM_exprloc References: <20110715181512.GA20327@host1.jankratochvil.net> Date: Mon, 18 Jul 2011 15:46:00 -0000 In-Reply-To: (Tom Tromey's message of "Fri, 15 Jul 2011 14:48:52 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-07/txt/msg00423.txt.bz2 Jan> archer-jankratochvil-vla handles DW_FORM_exprloc by using Jan> attr_form_is_block here. But that may be outside of the scope of Jan> this patch, this change is OK. Tom> I will change it to use attr_form_is_block; that seems totally Tom> reasonable to me. Here is what I am checking in. Tom 2011-07-15 Tom Tromey * dwarf2read.c (read_subrange_type): Use attr_form_is_block when checking for variable-sized array. >From 6ccb8e249bfe359df263dd9d179ad6b88f3490ef Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 15 Jul 2011 11:35:35 -0600 Subject: [PATCH 4/4] also recognize DW_FORM_exprloc as dynamic range --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 8a6b142..b397af9 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8623,7 +8623,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_upper_bound, cu); if (attr) { - if (attr->form == DW_FORM_block1 || is_ref_attr (attr)) + if (attr_form_is_block (attr) || is_ref_attr (attr)) { /* GCC encodes arrays with unspecified or dynamic length with a DW_FORM_block1 attribute or a reference attribute. @@ -8706,7 +8706,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) /* Mark arrays with dynamic length at least as an array of unspecified length. GDB could check the boundary but before it gets implemented at least allow accessing the array elements. */ - if (attr && attr->form == DW_FORM_block1) + if (attr && attr_form_is_block (attr)) TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; /* Ada expects an empty array on no boundary attributes. */ -- 1.7.6