Demangle symbols in debug assertion messages

Jonathan Wakely
Thu May 21 10:00:00 GMT 2015

On 20/05/15 21:45 +0200, François Dumont wrote:
>On 20/05/2015 12:19, Jonathan Wakely wrote:
>Does this fix ?
>With the patch this code of the bug report generates the following 
>debug message:
>    error: attempt to retreat a past-the-end iterator 2 steps, which falls
>    outside its valid range.
>Objects involved in the operation:
>iterator @ 0x0x7fff32365c50 {
>  type = 
>__gnu_debug::_Safe_iterator<std::__cxx1998::_Deque_iterator<int, int&, 
>int*>, std::__debug::deque<int, std::allocator<int> > > (mutable 
>  state = past-the-end;
>  references sequence with type `std::__debug::deque<int, 
>std::allocator<int> >' @ 0x0x7fff32365cd0
>which looks nice.
>However I wouldn't say that bug is fixed because debug mode do not 
>generate mangle name, it simply rely on typeid to get it. Shouldn't 
>bug report be saying so ? Whatever, symbol generated by typeid can be 
>demangle by __cxa_demangle so it mustn't be that bad.

I was trying to demangle the names with c++filt, which failed. Users
should not have to write a C++ program using __cxa_demangle to read
the output.

If they are automatically demangled now then the bug is fixed.

More information about the Libstdc++ mailing list