From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8258 invoked by alias); 3 Mar 2008 17:02:17 -0000 Received: (qmail 8247 invoked by uid 22791); 3 Mar 2008 17:02:16 -0000 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO qnxmail.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Mar 2008 17:01:58 +0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.42.96.5]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id LAA17470; Mon, 3 Mar 2008 11:44:29 -0500 Received: from [10.42.100.129] (dhcp-100-129 [10.42.100.129]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id MAA18893; Mon, 3 Mar 2008 12:01:52 -0500 Message-ID: <47CC2F00.4000703@qnx.com> Date: Mon, 03 Mar 2008 17:02:00 -0000 From: Aleksandar Ristovski User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb@sourceware.org Subject: Re: Re: cp-name-parser.y References: <20080229202918.GB7757@caradoc.them.org> In-Reply-To: <20080229202918.GB7757@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-03/txt/msg00019.txt.bz2 Daniel Jacobowitz wrote: > On Fri, Feb 29, 2008 at 02:49:25PM -0500, Aleksandar Ristovski wrote: >> Daniel Jacobowitz wrote: >>> 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" >>>> > > Yes, we could take the unique string from the mangled name and call it > (anonymous namespace _MESS_OF_GARBAGE)::foobar, and then recognize > that syntax when we parse expressions. I think _MESS_OF_GARBAGE is already sufficient, without combining it with '(anonymous namespace)'. _MESS_OF_GARBAGE is used only if print demangle is off. For MI interface, it should (almost always?) be the case. When '(anonymous namespace)' is used, since it could be any anonymous namespace, it is not sufficient to uniquely identify a symbol and therefore we can only use this form if there is a valid frame that will give it a context. In either case, I see nothing wrong with the way it is printed out, I see the problem with parsing either of the forms: _MESS_OF_GARBAGE and '(anonymous namespace)'. The first can not be parsed due to '.' in it and the latter due to '(anonymous namespace)'. > > I don't know how the existing anonymous namespace code works. It was > David Carlton's work and I wasn't following it at the time. We need > them internally, to get bare lookup right, but maybe we should not > display them to the user - just call the type "foobar". I think it's ok the way it works now - makes it clear where it comes from. > > If we do that, though, what if there are multiple types named foobar? > Completely legal C++. Well, no worse than the problem we have in C > anyway - so maybe that's the change we should make. > > > We could recognize > that things with (anonymous namespace) in them are the names of C++ > symbols in c-exp.y. > Or we could write new cp-exp.y for parsing mangled and demangled names (but this probably overlaps with cp-name-parser)?