I use g++ 4.8 that supports c++ 11 feature on my mac.
/opt/local/bin/g++-mp-4.8
I also use gdb 6.3.50.
GNU gdb 6.3.50-20050815 (Apple version gdb-1822) (Sun Aug 5 03:00:42 UTC 2012)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
My code has a lot of maps or vectors that has unique_ptr, and it's really pain to debug them as I see no information about the elements in the map or vector.
I tried to make a utility method and call them in gdb, but it doesn't seem to work. It doesn't throw error message, but it also shows nothing.
void testPrint( map<int, unique_ptr<GroupContextSummary>> & m, int i )
{
cout << m[i].get()->to_string() << endl;
}
Are there any ways to see the elements in the map/vector?