This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: EEEEKS! The mangling changed!
Carlo Wood <carlo@alinoe.com> writes:
> After thinking about it for a while, I understand that this cannot be
> changed. Nevertheless, the problem that I sketched exists.
> I propose to solve that problem by making an exception in the demanglers
> and let them produce "std::" instead of "__gnu_norm::".
> I am sure gdb will also be happy with that - or else they will have
> to do it themselfs (matching what the user types against __gnu_norm
> makes no sense). In fact, if you don't do this in the demangler, all
> debug tools will have to do the translation themselfs in a much more
> cpu consuming way.
>
> The argument AGAINST this would be that the symbol *really* sits in
> in namespace __gnu_norm and thus some people will want to KNOW that.
> But that is turning everything upside down: the aim of this patch
> is make it completely hidden for everyone and to get an environment
> that is completely equivalent to what it was before. Therefore
> __gnu_norm is a 100% synonym for std::, as long as do not also
> translate __gnu_debug :). __gnu_debug should stay what it is,
> of course.
>
> Ian, do you agree with me? Better to change the demangler then
> to change all the demangler testsuite cases that contain an STL
> container. Right?
Wow, I kind of dislike the idea of having the demangler incorporate
quasi-hidden information, like automatic translation of namespaces. I
mean, std::vector<> and __gnu_norm::vector<> really are different
types, aren't they? Having the demangler confuse the two is bound to
mess somebody up eventually. I understand what you are saying, that
__gnu_norm:: and std:: should be equivalent, but still I think that
somebody is going to have trouble.
There is obviously a real debugging issue here. Error messages are
going to change and become even less comprehensible. And unless the
using attribute ((strong)) stuff is output in the debugging
information--how?--gdb users are not going to be able to do stuff
which ought to just work.
I wonder if there is some way that we could add another namespace
attribute, alias. If X does ``using namespace Y attribute
((alias))'', then a reference to X::T<...> is treated kind of like
typedef Y::T<...> X::T<...>;
(if that were legal C++, that is). Then we make sure that all the
name mangling and debugging information refers to X::T<...> rather
than Y::T<...>. We would then do an alias for __gnu_norm, but not for
__gnu_debug.
Ian