From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32032 invoked by alias); 27 Jun 2010 18:35:42 -0000 Received: (qmail 32022 invoked by uid 22791); 27 Jun 2010 18:35:41 -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) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 27 Jun 2010 18:35:38 +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 o5RIZaVI011899 for ; Sun, 27 Jun 2010 11:35:36 -0700 Received: from vws6 (vws6.prod.google.com [10.241.21.134]) by wpaz17.hot.corp.google.com with ESMTP id o5RIZZn1016870 for ; Sun, 27 Jun 2010 11:35:35 -0700 Received: by vws6 with SMTP id 6so1388323vws.11 for ; Sun, 27 Jun 2010 11:35:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.122.217 with SMTP id m25mr2240525vcr.264.1277663734927; Sun, 27 Jun 2010 11:35:34 -0700 (PDT) Received: by 10.220.180.70 with HTTP; Sun, 27 Jun 2010 11:35:34 -0700 (PDT) In-Reply-To: <20100627182442.AF5CA84613@ruffy.mtv.corp.google.com> References: <20100627182442.AF5CA84613@ruffy.mtv.corp.google.com> Date: Sun, 27 Jun 2010 18:35:00 -0000 Message-ID: Subject: Re: [RFA] Fix PR gdb/11702, printing of static const member variables From: Doug Evans To: gdb-patches@sourceware.org Cc: jan.kratochvil@redhat.com 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/msg00623.txt.bz2 On Sun, Jun 27, 2010 at 11:24 AM, Doug Evans wrote: > Hi. > > This patch fixes http://sourceware.org/bugzilla/show_bug.cgi?id=3D11702 > > [...] > > There is one outstanding issue. > "info var static_const_member" should work, I *think*. > Is that true? > If so, then more work needs to be done (or even a different approach, > but the current patch seems reasonable). > > symtab.c:search_symbols has this: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0if (file_matches (real_symtab->filename, files= , nfiles) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&& ((regexp =3D=3D NULL > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 || re_exec (SYMBOL_NATURAL_NA= ME (sym)) !=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&& ((kind =3D=3D VARIABLES_DOM= AIN && SYMBOL_CLASS (sym) !=3D LOC_TYPEDEF > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && SYMBOL_CLASS (sym)= !=3D LOC_UNRESOLVED > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && SYMBOL_CLASS (sym)= !=3D LOC_BLOCK >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && SYMBOL_CLASS (sym) != =3D LOC_CONST) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0|| (kind =3D=3D FUNCTI= ONS_DOMAIN && SYMBOL_CLASS (sym) =3D=3D LOC_BLOCK) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0|| (kind =3D=3D TYPES_= DOMAIN && SYMBOL_CLASS (sym) =3D=3D LOC_TYPEDEF)))) > > > This prevents static const members from being found using the current > implementation. =A0Why do we care about LOC_CONST here? > [And, if we do, this also needs to check LOC_CONST_BYTES ...] Sigh. The LOC_CONST here is used to catch enums. Maybe another symbol table cleanup is to not put enum values in VARIABLES_DOMAIN.