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]

alternate __cxa_demangle implementation


On Thu, Jan 02, 2003 at 11:17:33PM -0600, Benjamin Kosnik wrote:
> Also, I get trailing bits in some demangled names when I run
> 'make check-abi':
>
>	_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_
>	demangled symbol
>	std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)!
>
> Note the last '!'.


This is not a bug in my orignial code, it seems:

~/c++/demangler>dt _ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_
std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)

There is no '!' at the end.


> I'm unsure what to do with the debugging hooks, but leaving in
> references to libcwd is not going to work.

Removing the debugging hooks will make the code unmaintainable.
At least, it will become 10,000 harder to find bugs - and bugs
will (of course) be introduced after making changes.  Thus...
unmaintainable.  I urge you to find a way to keep the debug hooks
in.

> I'm not quite sure "session" really captures what is being attempted
> here. I would like a bit more time on this, I think.

A "session" is the state object for a new encoding, including pointers
into the input buffer (where are we with decoding?), lists of current
substitutions (also pointers into the input string) and the decoded
output-so-far.  Encodings can recursively contain other encodings, the
old state needs to be kept on the stack in the meantime and not being
clobbered by the recursive call.  I suppose you could rename 'session'
to 'encoding' and then capture a PART of the data members of the object,
but I certainly wouldn't rename the instance names of the session object,
because that would make the code less readable as a session object has
many 'decode' methods that work on the *current* input position and
have at that moment little to do with the full encoding that you started
with.

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