From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29827 invoked by alias); 28 Jun 2010 18:26:21 -0000 Received: (qmail 29791 invoked by uid 22791); 28 Jun 2010 18:26:20 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,TW_GD,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Jun 2010 18:26:17 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id o5SIQELR011101 for ; Mon, 28 Jun 2010 11:26:14 -0700 Received: from vws8 (vws8.prod.google.com [10.241.21.136]) by wpaz17.hot.corp.google.com with ESMTP id o5SIO4pm010853 for ; Mon, 28 Jun 2010 11:26:13 -0700 Received: by vws8 with SMTP id 8so3147854vws.36 for ; Mon, 28 Jun 2010 11:26:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.48.131 with SMTP id r3mr3152864vcf.81.1277749572577; Mon, 28 Jun 2010 11:26:12 -0700 (PDT) Received: by 10.220.180.70 with HTTP; Mon, 28 Jun 2010 11:26:12 -0700 (PDT) In-Reply-To: <20100628110222.GA21051@host0.dyn.jankratochvil.net> References: <20100627182442.AF5CA84613@ruffy.mtv.corp.google.com> <20100628110222.GA21051@host0.dyn.jankratochvil.net> Date: Mon, 28 Jun 2010 18:26:00 -0000 Message-ID: Subject: Re: [RFA] Fix PR gdb/11702, printing of static const member variables From: Doug Evans To: Jan Kratochvil Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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/msg00644.txt.bz2 On Mon, Jun 28, 2010 at 4:02 AM, Jan Kratochvil wrote: > 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. =A0[4.1 Data Object Entries] >> However, dwarf2_add_field is calling die_is_declaration. > > echo 'class C { static const float i =3D 1; } c;'|g++ -c -o 1.o -Wall -g = -x c++ - > =A0 =A0< c> =A0 DW_AT_producer =A0 =A0: (indirect string, offset: 0x11): = GNU C++ 4.6.0 20100628 (experimental) > =A0<2><33>: Abbrev Number: 3 (DW_TAG_member) > =A0 =A0<34> =A0 DW_AT_name =A0 =A0 =A0 =A0: i > =A0 =A0<38> =A0 DW_AT_type =A0 =A0 =A0 =A0: <0x45> > =A0 =A0<3c> =A0 DW_AT_external =A0 =A0: 1 > =A0 =A0<3d> =A0 DW_AT_accessibility: 3 =A0 =A0 =A0 (private) > =A0 =A0<3e> =A0 DW_AT_declaration : 1 > =A0 =A0<3f> =A0 DW_AT_const_value : 4 byte block: 0 0 80 3f > > Isn't it primarily a bug in GCC? =A0There 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 ma= ke > the GCC change only for -gdwarf-4 upwards which is incompatible with older > GDBs anyway? I'm not sure I follow. If all the GCC versions we care about are also adding DW_AT_external to the DIE, gdb *could* check for it instead of die_is_declaration, right? Or am I missing something? > 4.4.5 20100627 uses DW_TAG_variable but 4.5.1 20100627 uses DW_TAG_member. Ah. > Otherwise - for the second patch - there are some needless whitespace cha= nges. > 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_BYT= ES. I'll add a few more testcases. Thanks. [And I'll check the whitespace fix in separately.]