This is the mail archive of the archer@sourceware.org mailing list for the Archer 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]

[python] Anonymous namespaces prevent some Python pretty-printing


Greetings,

Consider:

--- simple-stl3.cc ---
#include <map>

namespace {
struct Foo {
};
}

int main(int argc, char *argv[])
{
  std::map<int, Foo> m;
  return 0; // break here
}
--- simple-stl3.cc ---

When printing this with Tom's StdMap printer, this results in:

Traceback (most recent call last):
  File "<string>", line 13, in _format_children
  File "/home/ppluzhnikov/.gdbinit.py", line 160, in children
    keytype = tp.template_argument(0)
RuntimeError: syntax error, near `<unnamed>::Foo, std::less<int>, std::'

That's because
  cp_demangled_name_to_comp("std::map<int, <unnamed>::Foo, std::less<int>, std::allocator<std::pair<const int, <unnamed>::Foo> > >", ...)
returns NULL, with error set to "syntax error, near ..."

It strikes me that the whole split and rejoin mechanism that
typy_template_argument uses is very fragile.

Not sure what can be done about it though :(

--
Paul Pluzhnikov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]