From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14046 invoked by alias); 12 Apr 2016 07:00:54 -0000 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 Received: (qmail 14011 invoked by uid 89); 12 Apr 2016 07:00:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=relocate, 0xa1, H*RU:HELO, Hx-spam-relays-external:HELO X-HELO: mga14.intel.com Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Apr 2016 07:00:42 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 12 Apr 2016 00:00:41 -0700 X-ExtLoop1: 1 Received: from heckel-mobl3.ger.corp.intel.com (HELO [172.28.205.63]) ([172.28.205.63]) by fmsmga001.fm.intel.com with ESMTP; 12 Apr 2016 00:00:38 -0700 Subject: Re: [PATCH v2] gdb: dwarf2read: implement handling of variables in Fortran common block To: G Helffrich , gdb-patches@sourceware.org References: <13D2DB40-8745-4CF0-BA56-C88D4741610C@gmail.com> Cc: Luis Machado From: "Heckel, Bernhard" Message-ID: <570C9D13.50307@intel.com> Date: Tue, 12 Apr 2016 07:00:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <13D2DB40-8745-4CF0-BA56-C88D4741610C@gmail.com> Content-Type: text/plain; charset="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00236.txt.bz2 On 12/04/2016 02:31, G Helffrich wrote: > This patch allows the gdb DWARF reader to handle variables located in For= tran common blocks. This fixes 20 unexpected failures in the gdb.fortran t= estsuite with host, target and build triplet x86_64-apple-darwin13.4.0 with= gfortran 4.9.2. > Re-posted as requested with patch file attached. Revised from original p= ost to prevent double relocation. > 2015-04-12 George Helffrich > > * dwarf2read.c (read_common_block): Relocate symbols in Fortran = common > blocks properly, and avoid double relocation. > (read_new_symbol_full): Don't discard zero-offset symbols in F= ortran > common blocks. > (_initialize_dwarf2_read): Add debug diagnostic print for comm= on > symbols. > * psymtab.c (print_partial_symbols): Recognize and print > COMMON_BLOCK_DOMAIN. > * symmisc.c (print_symbol): Recognize and dump LOC_COMMON_BLOCK. > > Hi George, Luis, I manually patched last week and got 16 fails in the common block testcase. Just adding a base-address to the variables lead to failing tests. From what I have seen, all the child's of the common block have their=20 own fix (DW_OP_addr) location. At least in my environment when I check the DWARF of the compiled testcase. Here an excerpt of my DWARF <2><4a>: Abbrev Number: 3 (DW_TAG_common_block) <4b> DW_AT_name : (indirect string, offset: 0x0): fo_o <4f> DW_AT_decl_file : 1 <50> DW_AT_decl_line : 31 <51> DW_AT_linkage_name: (indirect string, offset: 0x5): fo_o_ <55> DW_AT_location : 9 byte block: 3 60 10 60 0 0 0 0 0=20=20=20= =20=20 (DW_OP_addr: 601060) <5f> DW_AT_sibling : <0xa1> <3><63>: Abbrev Number: 4 (DW_TAG_variable) <64> DW_AT_name : ix <67> DW_AT_decl_file : 1 <68> DW_AT_decl_line : 23 <69> DW_AT_type : <0x116> <6d> DW_AT_external : 1 <6d> DW_AT_location : 9 byte block: 3 60 10 60 0 0 0 0 0=20=20=20= =20=20 (DW_OP_addr: 601060) <3><77>: Abbrev Number: 4 (DW_TAG_variable) <78> DW_AT_name : iy2 <7c> DW_AT_decl_file : 1 <7d> DW_AT_decl_line : 24 <7e> DW_AT_type : <0x11d> <82> DW_AT_external : 1 <82> DW_AT_location : 9 byte block: 3 64 10 60 0 0 0 0 0=20=20=20= =20=20 (DW_OP_addr: 601064) May George can sent the important part of the DWARF Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928