From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6920 invoked by alias); 5 Jul 2013 19:08:56 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 6901 invoked by uid 89); 5 Jul 2013 19:08:55 -0000 X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 05 Jul 2013 19:08:51 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r65J8mro002181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Jul 2013 15:08:48 -0400 Received: from host2.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r65J8iMw030416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 5 Jul 2013 15:08:47 -0400 Date: Fri, 05 Jul 2013 19:08:00 -0000 From: Jan Kratochvil To: Rouslan Korneychuk Cc: "gdb@sourceware.org" Subject: Re: DW_AT_count is the same as DW_AT_upper_bound? Message-ID: <20130705190844.GA1296@host2.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 X-SW-Source: 2013-07/txt/msg00031.txt.bz2 On Fri, 05 Jul 2013 20:41:02 +0200, Rouslan Korneychuk wrote: > I'm using DW_AT_count instead of DW_AT_upper_bound so that "stack" can > be empty (have 0 elements), but these two attributes appear to be > treated the same. Is this a bug or am I misunderstanding something? I'm > using GDB version 7.5.1. DW_AT_upper_bound vs. DW_AT_count is described in DWARF-4: The DW_AT_upper_bound attribute may be replaced by a DW_AT_count attribute, whose value describes the number of elements in the subrange rather than the value of the last element. But your sample DWARF is a case of dynamic bounds which are supported only in experimental branch(es) so far: http://sourceware.org/gdb/wiki/FortranVLA particularly the branch jankratochvil/vla of git://sourceware.org/git/archer.git Jan