From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20786 invoked by alias); 21 Aug 2012 22:12:25 -0000 Received: (qmail 20774 invoked by uid 22791); 21 Aug 2012 22:12:23 -0000 X-SWARE-Spam-Status: No, hits=-5.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vb0-f41.google.com (HELO mail-vb0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Aug 2012 22:12:09 +0000 Received: by vbkv13 with SMTP id v13so418113vbk.0 for ; Tue, 21 Aug 2012 15:12:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=1mlMuI3Xo5G8CKirnfBKlAiGJClm0lAMcFlu5DCrcCU=; b=ZUuvmKfJFtjbZkpWB4ewBApSmnsr4hQEpAQQ3fbdO0KengYBYGnSTaJVp4ElevTmzz n2Pp4/ZmOz1d6gMJ+ekg+ePz4C23rFfuW6w2hKp50R4R88GCtP6JnmTigwGCzfM+bHAv ewLJ6Rg/NpsDAh910rPZSdgo4/ckwrWvoTYECPWOUVBkf9qZIvq+hnkbwGbSqvj1K/O8 GMOmWfX2p5iHFa6ddgwsxBbw4NWIuNJ04bYShe3yc5uQ7cyWCu6bJbAxzIQH9HlrM26p hU+QrJZ7s/iBTN6yzyXzIp26Y0lXGRM/5BihpntdTmJfLk7U/XaVFcU7q0bVY7Afwlfu aZtA== Received: by 10.52.73.5 with SMTP id h5mr12535531vdv.111.1345587128932; Tue, 21 Aug 2012 15:12:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.73.5 with SMTP id h5mr12535525vdv.111.1345587128823; Tue, 21 Aug 2012 15:12:08 -0700 (PDT) Received: by 10.52.27.11 with HTTP; Tue, 21 Aug 2012 15:12:08 -0700 (PDT) In-Reply-To: <87628cfbg2.fsf@fleche.redhat.com> References: <87628cfbg2.fsf@fleche.redhat.com> Date: Tue, 21 Aug 2012 22:12:00 -0000 Message-ID: Subject: Re: [3/3] RFC - optional patch to restore DW_AT_data_member_location From: Doug Evans To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQkL4Cq0pSPfTiA5+OeJE2CmqW6dRp9mbjEI3fYr+ZOJflO6zaXExtseLebSyH38YyYA2xzscted7fm+7h7S5fanHfCacWt6EcEqidczfVGRjok9J2nWH7Ml7ntib8+i0hkjgmEi6pYbSKd+ChdHkXJCjWNrUtjQYA8rNfTw2XJawBC8g3Y+EuDA3Qr1UCC0PyKF1Z/XSA55W/T9DfBVh53TL5kwOA== 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: 2012-08/txt/msg00603.txt.bz2 On Tue, Aug 21, 2012 at 9:37 AM, Tom Tromey wrote: > This patch reimplements DW_AT_data_member_location for variables > appearing in a Fortran common block. > > This attribute is not specified by DWARF. It is apparently an old > approach used by gfortran prior to 2008; at least it appeared in > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23057 > > This patch is based on the idea that such attributes are relatively > rare. So, rather than implement complicated support for them, gdb just > rewrites them into an ordinary location expression that uses the common > block's location as a subroutine. > > I've included a new test case, which I made by editing the assembly > output of gfortran by hand. > > Built and regtested on x86-64 Fedora 16. > > I consider this patch optional, because I think it is too much > complicated code in support of a marginal and obsolete feature. > However, I wrote it in case someone thinks that supporting 4 year old > versions of gfortran is important. > > Tom > > * dwarf2read.c (mark_common_block_symbol_computed): New function. > (read_common_block): Handle child DIEs with > DW_AT_data_member_location. > (new_symbol_full): Add special case for common blocks. > > * gdb.dwarf2/dw2-common-block.S: New file. > * gdb.dwarf2/dw2-common-block.exp: New file. I'm all for holding off until someone presents a *compelling* use case.