This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++/Java regressions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]