From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3589 invoked by alias); 29 Feb 2008 19:32:52 -0000 Received: (qmail 3571 invoked by uid 22791); 29 Feb 2008 19:32:52 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 29 Feb 2008 19:32:31 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 0DB70983A1; Fri, 29 Feb 2008 19:32:30 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id E8CB79831E; Fri, 29 Feb 2008 19:32:29 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JVAy5-0001L4-6l; Fri, 29 Feb 2008 14:32:29 -0500 Date: Fri, 29 Feb 2008 19:49:00 -0000 From: Daniel Jacobowitz To: Aleksandar Ristovski Cc: gdb@sourceware.org Subject: Re: cp-name-parser.y Message-ID: <20080229193229.GA4226@caradoc.them.org> Mail-Followup-To: Aleksandar Ristovski , gdb@sourceware.org References: <47C84D48.2020807@qnx.com> <20080229185513.GA2793@caradoc.them.org> <47C85859.2030403@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47C85859.2030403@qnx.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00264.txt.bz2 On Fri, Feb 29, 2008 at 02:09:13PM -0500, Aleksandar Ristovski wrote: > I am looking at that since right now something like this: > > -var-create - * "(anonymous namespace)::foobar" > > will not work since c_parse doesn't know anything about '(anonymous > namespace)'. I guess it wouldn't be too hard to hack around this > particular case, but a proper solution would be preferable. I wonder what the right thing to do on a statement like that is. The problem with anonymous namespaces is that we call them all "(anonymous namespace)", but they're many different namespaces, one for each file with anonymous namespaces. In that file, you would access the type as just "foobar". Maybe we should give each anonymous namespace a different name. Anyway, cp-name-parser.y isn't a replacement for c-exp.y. It's a name parser; it accepts both names and types in cases where we don't know which are which, and it does not support any expressions except when they can appear inside a template argument. Once you've identified something as a symbol name then you might hand it off to this parser to find the canonical form of the name, before searching the symbol table. > The issue is evident when using IDE (CDT). IDE will call > ptype foobar > which prints type (correctly) something like this: '(anonymous > namespace)::FooBar' and then IDE uses this string as argument to > -var-create, but unfortunately, this doesn't work. (Why are you creating a varobj for a type, anyway?) -- Daniel Jacobowitz CodeSourcery