From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3894 invoked by alias); 28 Jun 2010 11:02:37 -0000 Received: (qmail 3744 invoked by uid 22791); 28 Jun 2010 11:02:36 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,FAKE_REPLY_C,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_GD,T_RP_MATCHES_RCVD 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; Mon, 28 Jun 2010 11:02:27 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5SB2PLc019072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 Jun 2010 07:02:25 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5SB2NrZ020981 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 28 Jun 2010 07:02:25 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o5SB2NSA021499; Mon, 28 Jun 2010 13:02:23 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o5SB2MJt021498; Mon, 28 Jun 2010 13:02:22 +0200 Date: Mon, 28 Jun 2010 11:02:00 -0000 From: Jan Kratochvil To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Fix PR gdb/11702, printing of static const member variables Message-ID: <20100628110222.GA21051@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100627182442.AF5CA84613@ruffy.mtv.corp.google.com> User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-06/txt/msg00630.txt.bz2 On Sun, 27 Jun 2010 20:24:42 +0200, Doug Evans wrote: > btw, the dwarf4 standard, as I read it, says static member variables are > identified by having DW_AT_external. [4.1 Data Object Entries] > However, dwarf2_add_field is calling die_is_declaration. echo 'class C { static const float i = 1; } c;'|g++ -c -o 1.o -Wall -g -x c++ - < c> DW_AT_producer : (indirect string, offset: 0x11): GNU C++ 4.6.0 20100628 (experimental) <2><33>: Abbrev Number: 3 (DW_TAG_member) <34> DW_AT_name : i <38> DW_AT_type : <0x45> <3c> DW_AT_external : 1 <3d> DW_AT_accessibility: 3 (private) <3e> DW_AT_declaration : 1 <3f> DW_AT_const_value : 4 byte block: 0 0 80 3f Isn't it primarily a bug in GCC? There is no other DIE for `i' and it is a complete definition so there is no place for DW_AT_declaration there. Just such GCC change will be incompatible with existing GDBs, maybe to make the GCC change only for -gdwarf-4 upwards which is incompatible with older GDBs anyway? > This seems wrong, but I didn't address this here, other than to add > a note pointing this out (because some new code in new_symbol should match). I agree it is an issue for a different patch. > Also, I added a case to new_symbol to handle DW_TAG_member. > gcc uses DW_TAG_variable but the correct way AIUI is DW_TAG_member, 4.4.5 20100627 uses DW_TAG_variable but 4.5.1 20100627 uses DW_TAG_member. Otherwise - for the second patch - there are some needless whitespace changes. Also I would test also `float' const field there using LOC_CONST_BYTES; it works but just to test it, based on your IRC comments about LOC_CONST_BYTES. Thanks, Jan