Compat: Missing things from libstdc++-v3/python/libstdcxx/v6/printers.py

Jonathan Wakely jwakely.gcc@gmail.com
Wed Dec 14 11:06:00 GMT 2016


On 13 December 2016 at 19:49, Paul Smith wrote:
> Debugging GCC 6.2-built programs I found at least one data type left
> out of the STL pretty-printers for GDB (in my particular case, I
> discovered it's missing std::__cxx11::list).

That's already fixed on the gcc-6-branch so will work with 6.3 once
it's released.

> I can edit the file and just add an entry there to treat
> std::__cxx11::list the same as std::list, but looking at the latest
> content of the macros from the dev HEAD I see many other changes.  I
> assume some of these are related to newer code that will be available
> when GCC 7 is released though.
>
> So, my question is, are these macros intended to be backward-compatible
> such that if I use a newer set of macros with a program built with an
> older libstdc++ STL, should they still work?

Assuming by "macros" you mean the Python code (which has nothing
whatsoever to do with macros) then ... it depends.

> In other words if I take the latest set of printer macros from dev HEAD
> and start using them with GCC 6.2 (I use -std=gnu++14), are they
> intended to work (modulo bugs)?

In most cases yes, because a program being debugged might contain a
mix of code compiled by different GCC versions, so the printers need
to support the container implementations from previous GCC versions.

However, that isn't tested, so could break, and there are exceptions
to the rule. One that springs to mind is that in GCC 5
std::experimental::any can be constructed with an allocator, and the
printers grok such an object. In GCC 6 the allocator support was
removed from the type and from the printers, so the GCC 6 printers
cannot display a std::Experimental::any compiled with GCC 5 and
constructed with an allocator.



More information about the Gcc-help mailing list