Which compiler (and which version) did you use to create the test source?
I assume this was not the latest version of g++
. Here is what I get with g++ 4.4.3-4ubuntu5
:
$ gdb -q ./a.out Reading symbols from /tmp/a.out...done. (gdb) b 12 Breakpoint 1 at 0x400de3: file t.cc, line 12. (gdb) r Breakpoint 1, main () at t.cc:12 12 return 0; (gdb) p mapInt2 $1 = std::map with 1 elements = {[3] = 4}
Update:
This is what I get for the version: g ++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
I see a problem. The instructions you referenced are incorrect .
In particular, the instructions show: svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
, but the problem is that the python code reaches the internal elements of libstdc++
and therefore must match these internal elements ( for this reason, pretty printers are part of GCC, not part of GDB, a fact bruce.banner complained about).
When you made the new svn co ...
, you received a copy of the python code that no longer matches your internal libstdc++
elements, and that causes problems.
Specifically, svn log
shows that find_type
was added here:
r183732 | tromey | 2012-01-30 08:25:11 -0800 (Mon, 30 Jan 2012) | 27 lines
This is much later than gcc-4.4.3
. What you want to do is get pretty printers matching your version of libstdc++
, for example:
svn co svn://gcc.gnu.org/svn/gcc/branches/gcc_4_4_3_release/libstdc++-v3/python
With the exception of the command, the above will not work, because gcc 4.4.3 precedes cute printers.
Regardless, the implementation of std::map
(and most of the remaining internal STL elements) has not changed between 4.4.3 and 4.6, and this command works:
svn co svn://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch/libstdc++-v3/python