print of a types describes anonymous namespaces with <unnamed> whereas lookup.type needs (anonymous namespace). This is related with the fix done in 7933 . example: ------------------- #include <map> namespace { struct S { int a; S(): a(42) {} }; } int main() { std::map<int, S> h; S s; h[1] = s; return s.a; } ---------------------- python print gdb.parse_and_eval("h").type reports std::map<int, <unnamed>::S, std::less<int>, std::allocator<std::pair<const int, <unnamed>::S> > > The '<unnamed>::S' cannot fed into gdb.lookup_type, whereas gdb.lookup_type('(anonymous namespace)::S') works. gcc 4.4.5, gdb 7.2 and current git incidentally, python print gdb.parse_and_eval("h").type.template_argument(0) seems to break with RuntimeError: syntax error, near `<unnamed>::S, std::less<int>, std::al' it is really cut off at std::al (but that might be simply because it just prints x char of context, if that is the case a colon would make it clearer).
Created attachment 6723 [details] That fixed it for me