From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30000 invoked by alias); 26 Nov 2003 22:21:53 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 29989 invoked from network); 26 Nov 2003 22:21:50 -0000 Received: from unknown (HELO yosemite.airs.com) (209.128.65.135) by sources.redhat.com with SMTP; 26 Nov 2003 22:21:50 -0000 Received: (qmail 29298 invoked by uid 10); 26 Nov 2003 22:21:50 -0000 Received: (qmail 19605 invoked by uid 500); 26 Nov 2003 22:21:43 -0000 From: Ian Lance Taylor To: mec.gnu@mindspring.com (Michael Elizabeth Chastain) Cc: drow@mvista.com, gdb@sources.redhat.com Subject: Re: C++/Java regressions References: <20031126214341.626764B40B@berman.michael-chastain.com> Date: Wed, 26 Nov 2003 22:21:00 -0000 In-Reply-To: <20031126214341.626764B40B@berman.michael-chastain.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-11/txt/msg00270.txt.bz2 mec.gnu@mindspring.com (Michael Elizabeth Chastain) writes: > ian> Yes, I think it should print A::bar without the const. I have the > ian> patch in my sources, but I haven't checked it in yet. > > But what about: > > class Foo > { > public: > int method (); > int method () const; > }; > > If the name comes back as "Foo::method" then we have ambiguity > in gdb's output. > > I think the const looks ugly and the code that prints the function > name is also ugly. But I don't wanna print the same name for two > different methods. I have probably lost the context of the question. I am only talking about the case where DMGL_PARAMS is not passed. In that case, the demangler will indeed print `Foo::method' for both of your examples. For that matter, it will also print `Foo::method' for `int method (int);'. If DMGL_PARAMS is passed, then the demangler will print `Foo::method()' and `Foo::method() const' as usual. I think that is appropriate. Without DMGL_PARAMS, you can't distinguish any Foo::method overloaded based on parameter types. So it seems logical to me that you also shouldn't be able to distinguish overloading based on the method qualifier. And that is how the V2 demangler behaved when DMGL_PARAMS was not passed. Does that make sense? Ian