From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11328 invoked by alias); 28 Jun 2010 20:27:29 -0000 Received: (qmail 11315 invoked by uid 22791); 28 Jun 2010 20:27:28 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KAM_STOCKGEN,SPF_HELO_PASS,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 20:27:24 +0000 Received: from hpaq2.eem.corp.google.com (hpaq2.eem.corp.google.com [172.25.149.2]) by smtp-out.google.com with ESMTP id o5SKRLPg017420 for ; Mon, 28 Jun 2010 13:27:21 -0700 Received: from vws3 (vws3.prod.google.com [10.241.21.131]) by hpaq2.eem.corp.google.com with ESMTP id o5SKRJUA021594 for ; Mon, 28 Jun 2010 13:27:20 -0700 Received: by vws3 with SMTP id 3so615031vws.25 for ; Mon, 28 Jun 2010 13:27:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.121.140 with SMTP id h12mr3248202vcr.30.1277756839613; Mon, 28 Jun 2010 13:27:19 -0700 (PDT) Received: by 10.220.180.70 with HTTP; Mon, 28 Jun 2010 13:27:19 -0700 (PDT) In-Reply-To: <3752333521215815628@unknownmsgid> References: <41597.7287375883$1274454923@news.gmane.org> <201006161708.41089.pedro@codesourcery.com> <3752333521215815628@unknownmsgid> Date: Mon, 28 Jun 2010 20:27:00 -0000 Message-ID: Subject: Re: [RFA]dwarf reader: Avoid complaint on const type From: Doug Evans To: Pierre Muller Cc: Pedro Alves , 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/msg00662.txt.bz2 On Sun, Jun 20, 2010 at 3:39 PM, Pierre Muller wrote: > 2010-06-21 =A0Pierre Muller =A0 > > =A0 =A0 =A0 =A0* dwarf2read.c (process_die): Do not call new_symbol > =A0 =A0 =A0 =A0for DW_TAG_volatile_type and DW_TAG_const_type. > =A0 =A0 =A0 =A0(new_symbol): Do not add the name of DW_TAG_volatile_type > =A0 =A0 =A0 =A0and DW_TAG_const_type to the symbol list. > > > > Index: dwarf2read.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > retrieving revision 1.400 > diff -u -p -r1.400 dwarf2read.c > --- dwarf2read.c =A0 =A0 =A0 =A017 Jun 2010 22:36:41 -0000 =A0 =A0 =A01.4= 00 > +++ dwarf2read.c =A0 =A0 =A0 =A020 Jun 2010 21:57:23 -0000 > @@ -3210,12 +3210,14 @@ process_die (struct die_info *die, struc > =A0 =A0 case DW_TAG_base_type: > =A0 =A0 case DW_TAG_subrange_type: > =A0 =A0 case DW_TAG_typedef: > - =A0 =A0case DW_TAG_const_type: > - =A0 =A0case DW_TAG_volatile_type: > =A0 =A0 =A0 /* Add a typedef symbol for the type definition, if it has a > =A0 =A0 =A0 =A0 =A0DW_AT_name. =A0*/ > =A0 =A0 =A0 new_symbol (die, read_type_die (die, cu), cu); > =A0 =A0 =A0 break; > + =A0 =A0case DW_TAG_const_type: > + =A0 =A0case DW_TAG_volatile_type: > + =A0 =A0 =A0read_type_die (die, cu); > + =A0 =A0 =A0break; > =A0 =A0 case DW_TAG_common_block: > =A0 =A0 =A0 read_common_block (die, cu); > =A0 =A0 =A0 break; > @@ -8912,12 +8914,16 @@ new_symbol (struct die_info *die, struct > =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0case DW_TAG_base_type: > =A0 =A0 =A0 =A0 case DW_TAG_subrange_type: > - =A0 =A0 =A0 =A0case DW_TAG_const_type: > - =A0 =A0 =A0 =A0case DW_TAG_volatile_type: > =A0 =A0 =A0 =A0 =A0SYMBOL_CLASS (sym) =3D LOC_TYPEDEF; > =A0 =A0 =A0 =A0 =A0SYMBOL_DOMAIN (sym) =3D VAR_DOMAIN; > =A0 =A0 =A0 =A0 =A0add_symbol_to_list (sym, cu->list_in_scope); > =A0 =A0 =A0 =A0 =A0break; > + =A0 =A0 =A0 =A0case DW_TAG_const_type: > + =A0 =A0 =A0 =A0case DW_TAG_volatile_type: > + =A0 =A0 =A0 =A0 /* The name of the type given in the dwarf name atribut= e is the > + =A0 =A0 =A0 =A0 =A0 =A0name of the `normal' type and not a new type nam= e, so > + =A0 =A0 =A0 =A0 =A0 =A0do not register this as a new type name. =A0*/ > + =A0 =A0 =A0 =A0 break; > =A0 =A0 =A0 =A0case DW_TAG_enumerator: > =A0 =A0 =A0 =A0 =A0attr =3D dwarf2_attr (die, DW_AT_const_value, cu); > =A0 =A0 =A0 =A0 =A0if (attr) > > Hi. I'd like to reach closure on this and get rid of this testsuite failur= e. I *think* the patch to process_die is ok. I'm not sure about the patch to new_symbol though. AFAICT, new_symbol will never be called for DW_TAG_volatile_type/const_type (*including* via bad debug info - IOW the code itself would never call new_symbol for these tags). *If* that is true, I wouldn't mind calling gdb_assert (0) for those tags - make it clearer to the caller what the API is. One may want to just leave it alone and let the default case flag a complai= nt.