From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29425 invoked by alias); 15 Jul 2011 18:15:32 -0000 Received: (qmail 29417 invoked by uid 22791); 15 Jul 2011 18:15:32 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_GD 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; Fri, 15 Jul 2011 18:15:17 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6FIFHV2007707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Jul 2011 14:15:17 -0400 Received: from host1.jankratochvil.net ([10.3.113.13]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6FIFFct016802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jul 2011 14:15:16 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p6FIFEod020634; Fri, 15 Jul 2011 20:15:14 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p6FIFDV2020633; Fri, 15 Jul 2011 20:15:13 +0200 Date: Fri, 15 Jul 2011 18:28:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [4/4] RFC: dynamic arrays and DW_FORM_exprloc Message-ID: <20110715181512.GA20327@host1.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-07/txt/msg00396.txt.bz2 On Fri, 15 Jul 2011 20:08:51 +0200, Tom Tromey wrote: > A -gdwarf-4 regression: > > -PASS: gdb.fortran/multi-dim.exp: print valid variable bound array element > +FAIL: gdb.fortran/multi-dim.exp: print valid variable bound array element > > The bug here is that with DWARF 4, GCC uses DW_FORM_exprloc when > emitting the bounds of a variably-sized array. GDB, however, only > checks for DW_FORM_block1. > > Jan, any comments? [...] > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -8623,7 +8623,9 @@ 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 == DW_FORM_block1 > + || attr->form == DW_FORM_exprloc > + || is_ref_attr (attr)) and > - if (attr && attr->form == DW_FORM_block1) > + if (attr && (attr->form == DW_FORM_block1 > + || attr->form == DW_FORM_exprloc)) archer-jankratochvil-vla handles DW_FORM_exprloc by using attr_form_is_block here. But that may be outside of the scope of this patch, this change is OK. Thanks, Jan