From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31371 invoked by alias); 9 Mar 2011 07:12:28 -0000 Received: (qmail 31362 invoked by uid 22791); 9 Mar 2011 07:12:27 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,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; Wed, 09 Mar 2011 07:12:13 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p297CBBs016755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Mar 2011 02:12:11 -0500 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p297CAkM023583 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 9 Mar 2011 02:12:11 -0500 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p297C9vB006799 for ; Wed, 9 Mar 2011 08:12:09 +0100 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p297C9CX006798 for gdb-patches@sourceware.org; Wed, 9 Mar 2011 08:12:09 +0100 Date: Wed, 09 Mar 2011 11:46:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: revert: Re: [patch] Fix DWARF-3+ DW_AT_accessibility default assumption Message-ID: <20110309071209.GA6661@host1.jankratochvil.net> References: <20110125193748.GA25086@host1.dyn.jankratochvil.net> <20110308175550.GA4384@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110308175550.GA4384@host1.jankratochvil.net> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-03/txt/msg00588.txt.bz2 On Tue, 08 Mar 2011 18:55:50 +0100, Jan Kratochvil wrote: > Checked in. Dealing with testsuite results on FSF GDB was difficult. > http://sourceware.org/ml/gdb-cvs/2011-03/msg00115.html Reverted. It broke compatibility with `gcc-4.5 -gdwarf-3'. gcc-4.5 violates DWARF: <1><2d>: Abbrev Number: 2 (DW_TAG_class_type) <2e> DW_AT_name : C <30> DW_AT_byte_size : 4 <2><37>: Abbrev Number: 3 (DW_TAG_member) <38> DW_AT_name : (indirect string, offset: 0x0): public_ <3e> DW_AT_type : <0x44> <42> DW_AT_data_member_location: 0 DWARF-4 specifies: An inheritance entry may have a DW_AT_accessibility attribute. If no accessibility attribute is present, private access is assumed for an entry of a class and public access is assumed for an entry of an interface, struct or union. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45124 There will probably need to be a DW_AT_producer check. Sorry, Jan http://sourceware.org/ml/gdb-cvs/2011-03/msg00128.html --- src/gdb/ChangeLog 2011/03/09 06:24:05 1.12775 +++ src/gdb/ChangeLog 2011/03/09 07:07:53 1.12776 @@ -1,3 +1,11 @@ +2011-03-09 Jan Kratochvil + + Revert: + 2011-03-08 Jan Kratochvil + Fix DWARF-3+ DW_AT_accessibility default assumption. + * dwarf2read.c (dwarf2_add_field): Fix new_field->accessibility for + cu->header.version >= 3. + 2011-03-09 Yao Qi * common/Makefile.in: Remove. --- src/gdb/dwarf2read.c 2011/03/08 17:54:44 1.507 +++ src/gdb/dwarf2read.c 2011/03/09 07:07:55 1.508 @@ -6238,25 +6238,13 @@ } fip->nfields++; - if (cu->header.version < 3) - { - /* The default DWARF 2 accessibility for members is public, the default - accessibility for inheritance is private. */ - - if (die->tag != DW_TAG_inheritance) - new_field->accessibility = DW_ACCESS_public; - else - new_field->accessibility = DW_ACCESS_private; - } + /* Handle accessibility and virtuality of field. + The default accessibility for members is public, the default + accessibility for inheritance is private. */ + if (die->tag != DW_TAG_inheritance) + new_field->accessibility = DW_ACCESS_public; else - { - /* DWARF 3 specifies the default accessibility explicitly. */ - - if (die->parent->tag == DW_TAG_class_type) - new_field->accessibility = DW_ACCESS_private; - else - new_field->accessibility = DW_ACCESS_public; - } + new_field->accessibility = DW_ACCESS_private; new_field->virtuality = DW_VIRTUALITY_none; attr = dwarf2_attr (die, DW_AT_accessibility, cu);