This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: EEEEKS! The mangling changed!


On Sat, Nov 29, 2003 at 11:25:24PM -0500, Ian Lance Taylor wrote:
> Wow, I kind of dislike the idea of having the demangler incorporate
> quasi-hidden information, like automatic translation of namespaces.  I

Yeah... I don't like it really myself either, I am a purist.
On the other hand should this __gnu_norm by an alias for std
indeed;  The solution with the alias given you Gaby and you
strike me as a LOT more logic: just mangle it as 'St'.

What we seem to need a 'chroot' for namespaces heheh.
(Thus, set root to __gnu_debug, then ::std is really
 __gnu_debug::std.).

Hmmmm, wait-a-minute.

What is wrong with:

#ifdef _GLIBCXX_DEBUG
namespace __gnu_debug
{
  using namespace std;

  // Debug class implementation
  template<typename _Tp, typename _Alloc = allocator<_Tp> >
    class list
    {
      // ...
    };
}
#endif

namespace std
{
#ifdef _GLIBCXX_DEBUG
  using namespace __gnu_debug __attribute__ ((strong));
#else
  // Normal class implementation
  template<typename _Tp, typename _Alloc = allocator<_Tp> >
    class list
    {
      // ...
    };
#endif
}

At first I thougt that this was not possible
because in debug you need both implementation next to
eachother - but this is all templates, only header files,
so at any moment 'std::list' is one or the other,
and everything else is just linker level: what already
was compiled is still std::list or __gnu_debug::list
respectively.

Is it a problem that you cannot refer to a __gnu_norm::list
while in debug mode (from user code, when that is needed
from the implementation itself then I am sure there is
a way around that).

Because if so (and the above is not usable), then in
debug mode the coder needs to have:

1) std::list        --> debug list
2) __gnu_norm::list --> normal list

and that, and only that, cannot be done.

(because you'd need:

namespace __gnu_norm {
  using namespace std;	// containing normal implementation.
  			// and it doesn't contain the normal
			// implementation in debug mode.
}

or __gnu_norm::list would have a different
mangling then the normal list in normal mode.

)

So, is it needed that the _user_ has access to __gnu_norm::
in debug mode?

-- 
Carlo Wood <carlo@alinoe.com>


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