From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22177 invoked by alias); 13 Feb 2013 17:59:13 -0000 Received: (qmail 22168 invoked by uid 22791); 13 Feb 2013 17:59:13 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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; Wed, 13 Feb 2013 17:59:04 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1DHx3nf001402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Feb 2013 12:59:03 -0500 Received: from host2.jankratochvil.net (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1DHwxRO020042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 13 Feb 2013 12:59:01 -0500 Date: Wed, 13 Feb 2013 17:59:00 -0000 From: Jan Kratochvil To: Michael Haupt Cc: "gdb@sourceware.org" Subject: Re: debugging custom array types Message-ID: <20130213175858.GA7244@host2.jankratochvil.net> References: <20130211170221.GA16645@host2.jankratochvil.net> 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-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00049.txt.bz2 On Wed, 13 Feb 2013 11:50:34 +0100, Michael Haupt wrote: > Is there documentation somewhere that explicates which pieces of DWARF gdb > supports out of the box? No, read the source. > <1><5320>: Abbrev Number: 16 (DW_TAG_structure_type) > <5321> DW_AT_name : (indirect string, offset: 0x177): char_array > <5325> DW_AT_byte_size : 10 byte block: 97 23 8 94 4 8 2 1e 23 c > <5330> DW_AT_sibling : <0x5359> > <2><5334>: Abbrev Number: 10 (DW_TAG_member) > <5335> DW_AT_name : (indirect string, offset: 0xdc): __hub_reference__ > <5339> DW_AT_type : <0x5c6f> > <533d> DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0) > <2><5340>: Abbrev Number: 10 (DW_TAG_member) > <5341> DW_AT_name : (indirect string, offset: 0x185): __length__ > <5345> DW_AT_type : <0x2d> > <5349> DW_AT_data_member_location: 2 byte block: 23 8 (DW_OP_plus_uconst: 8) > <2><534c>: Abbrev Number: 10 (DW_TAG_member) > <534d> DW_AT_name : (indirect string, offset: 0x195): __array__ > <5351> DW_AT_type : <0x5a6c> > <5355> DW_AT_data_member_location: 2 byte block: 23 c (DW_OP_plus_uconst: 12) > ... > <1><5a6c>: Abbrev Number: 11 (DW_TAG_array_type) > <5a6d> DW_AT_type : <0x4f11> > <5a71> DW_AT_byte_size : 8 byte block: 97 23 8 94 4 8 2 1e > <5a7a> DW_AT_data_location: 3 byte block: 97 23 c (DW_OP_push_object_address; DW_OP_plus_uconst: 12) > <5a7e> DW_AT_sibling : <0x5a91> > <2><5a82>: Abbrev Number: 14 (DW_TAG_subrange_type) > <5a83> DW_AT_type : <0x2d> > <5a87> DW_AT_upper_bound : 8 byte block: 97 23 8 94 4 8 1 1c (DW_OP_push_object_address; DW_OP_plus_uconst: 8; DW_OP_deref_size: 4; DW_OP_const1u: 1; DW_OP_minus) Even archer-jankratochvil-vla branch does not support dynamic structures: dwarf2read.c: read_structure_type: attr = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr) { TYPE_LENGTH (type) = DW_UNSND (attr); } That DW_TAG_array_type/DW_TAG_subrange_type with dynamic DW_AT_upper_bound should be supported but not as a directly embedded part of struct. BTW archer-jankratochvil-vla is generally wrong, its reimplementation was discussed in: plan: VLA (Variable Length Arrays) and Fortran dynamic types http://sourceware.org/ml/gdb/2012-11/msg00094.html Regards, Jan