From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B89E239A0027 for ; Fri, 4 Jun 2021 19:40:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B89E239A0027 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 154JeCxT014333 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 4 Jun 2021 15:40:16 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 154JeCxT014333 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D0F9A1E813; Fri, 4 Jun 2021 15:40:11 -0400 (EDT) Subject: Re: [PATCH v2] Add PROP_VARIABLE_NAME To: Tom Tromey , gdb-patches@sourceware.org References: <20210604173059.3021089-1-tromey@adacore.com> From: Simon Marchi Message-ID: Date: Fri, 4 Jun 2021 15:40:11 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210604173059.3021089-1-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 4 Jun 2021 19:40:12 +0000 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 19:40:29 -0000 On 2021-06-04 1:30 p.m., Tom Tromey wrote: > With -fgnat-encodings=minimal, an internal version (these patches will > be upstreamed in the near future) of the Ada compiler can emit DWARF > for an array where the bound comes from a variable, like: > > <1><12a7>: Abbrev Number: 7 (DW_TAG_array_type) > <12a8> DW_AT_name : (indirect string, offset: 0x1ae9): pck__my_array > [...] > <2><12b4>: Abbrev Number: 8 (DW_TAG_subrange_type) > <12b5> DW_AT_type : <0x1294> > <12b9> DW_AT_upper_bound : <0x1277> > > With the upper bound DIE being: > > <1><1277>: Abbrev Number: 2 (DW_TAG_variable) > <1278> DW_AT_name : (indirect string, offset: 0x1a4d): pck__my_length___U > <127c> DW_AT_type : <0x128f> > <1280> DW_AT_external : 1 > <1280> DW_AT_artificial : 1 > <1280> DW_AT_declaration : 1 > > Note that the variable is just a declaration -- in this situation, the > variable comes from another compilation unit, and must be found when > trying to compute the array bound. > > This patch adds a new PROP_VARIABLE_NAME kind, to enable this search. > > This same scenario can occur with DW_OP_GNU_variable_value, so this > patch adds support for that as well. The changes following my feedback LGTM, thanks. Simon