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!


A last clarification, the previous test code contains all relevant
possibilities and generates the following symbols:

* In normal mode:

~/c++/tests/__gnu_norm>g++-cvs-3.4 -c test.cc
~/c++/tests/__gnu_norm>nm -C test.o | grep vector
00000000 W __gnu_norm::vector<MyType, std::allocator<MyType> >::vector()
00000000 W __gnu_norm::vector<int, std::allocator<int> >::vector(std::allocator<int> const&)
00000000 W __gnu_norm::vector<int, std::allocator<int> >::~vector()

* In debug mode:

~/c++/tests/__gnu_norm>g++-cvs-3.4 -D_GLIBCXX_DEBUG -c test.cc
~/c++/tests/__gnu_norm>nm -C test.o | grep vector
00000000 W __gnu_norm::vector<MyType, std::allocator<MyType> >::vector()
00000000 W __gnu_norm::vector<int, std::allocator<int> >::vector(std::allocator<int> const&)
00000000 W __gnu_norm::vector<int, std::allocator<int> >::~vector()
00000000 W __gnu_debug::_Safe_sequence<__gnu_debug_def::vector<int, std::allocator<int> > >::_Safe_sequence()
00000000 W __gnu_debug::_Safe_sequence<__gnu_debug_def::vector<int, std::allocator<int> > >::~_Safe_sequence()
00000000 W __gnu_debug_def::vector<MyType, std::allocator<MyType> >::vector()
00000000 W __gnu_debug_def::vector<int, std::allocator<int> >::vector(std::allocator<int> const&)
00000000 W __gnu_debug_def::vector<int, std::allocator<int> >::~vector()

(Note the debug mode example contains all symbols also in normal mode).


Now, my proposal is to change the mangling of this into:

00000000 W _ZNSt6vectorI6MyTypeSaIS0_EEC1Ev
00000000 W _ZNSt6vectorIiSaIiEEC2ERKS1_
00000000 W _ZNSt6vectorIiSaIiEED2Ev
00000000 W _ZN11__gnu_debug14_Safe_sequenceIN15__gnu_debug_def6vectorIiSaIiEEEEC2Ev
00000000 W _ZN11__gnu_debug14_Safe_sequenceIN15__gnu_debug_def6vectorIiSaIiEEEED2Ev
00000000 W _ZN15__gnu_debug_def6vectorI6MyTypeSaIS1_EEC1Ev
00000000 W _ZN15__gnu_debug_def6vectorIiSaIiEEC1ERKS1_
00000000 W _ZN15__gnu_debug_def6vectorIiSaIiEED1Ev

which would demangle into

00000000 W std::vector<MyType, std::allocator<MyType> >::vector()
00000000 W std::vector<int, std::allocator<int> >::vector(std::allocator<int> const&)
00000000 W std::vector<int, std::allocator<int> >::~vector()
00000000 W __gnu_debug::_Safe_sequence<__gnu_debug_def::vector<int, std::allocator<int> > >::_Safe_sequence()
00000000 W __gnu_debug::_Safe_sequence<__gnu_debug_def::vector<int, std::allocator<int> > >::~_Safe_sequence()
00000000 W __gnu_debug_def::vector<MyType, std::allocator<MyType> >::vector()
00000000 W __gnu_debug_def::vector<int, std::allocator<int> >::vector(std::allocator<int> const&)
00000000 W __gnu_debug_def::vector<int, std::allocator<int> >::~vector()

in other words, a 'normal' std::vector will still
look as 'std::vector' after demangling.  While the
debug vector will look different, instead of that
both are different.  Specializations turn out not
to be a problem at all.

-- 
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]