EEEEKS! The mangling changed!

Carlo Wood carlo@alinoe.com
Sun Nov 30 03:18:00 GMT 2003


On Sun, Nov 30, 2003 at 03:26:21AM +0100, Gabriel Dos Reis wrote:
> | That makes it nearly unrecognizable and at least questionably whenever it is
> | demangled by which-ever debugging tool.  When the programmer uses "std::"
> | he wants it to BE "std::"
> 
> No.  The programmer has absolutely no control over what is in std::.
> When he/she says std::, he/she gets whatever name lookup happen to
> find there. 

No- it is not nearly unrecognizable and at least questionably whenever
it is used by which-ever debugging tool, or
No- the programmer uses "std::" and doesn't want it to be "std::" then?

I think the answer is yes to both, at least for me, and I am a programmer.
Trivially I have no control over what is in std:: or what I will get
when I use std::xyz - but I never claimed that.

> Not everything in std:: gets resolved to __gnu_norm::.  You might want
> to consult the documentation relating that work.  Things that are
> really defined in std are still mangled as before.

Ok, and as you will have understood, the memory consumption was a joke.

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?

Overview:

In source code:
Always and only "std::"    ---normal mode--> (__gnu_norm)  ---demangler-->  std::vector
                           ---debug mode---> (__gnu_debug) ---demangler-->  __gnu_debug::vector

Hmm, gdb will have to translate __gnu_debug to std too before
matching, now I think about it - but it should _print/show_ __gnu_debug when
it finds something.

There is no reason not to hide __gnu_norm completely though.

-- 
Carlo Wood <carlo@alinoe.com>



More information about the Libstdc++ mailing list