How to display the contents of std :: multimap and std :: multiset in a debugger in QtCreator?

I am trying to check the contents of std::multimap and std::multiset in the Locales and QtCreator expressions window .

Instead of a list of values, I get implementation information.

It is strange that copies of std::map and std::set are shown in order:

 #include <iostream> #include <map> #include <set> #include <string> int main() { std::multimap<int, std::string> multimap; multimap.insert(std::make_pair(1, "one")); multimap.insert(std::make_pair(2, "two")); multimap.insert(std::make_pair(3, "three")); std::multiset<int> multiset = {1,2,3}; std::map<int, std::string> map; map.insert(std::make_pair(1, "one")); map.insert(std::make_pair(2, "two")); map.insert(std::make_pair(3, "three")); std::set<int> set = {1,2,3}; return 0; } 

enter image description here

I use:

 Qt Creator 3.0.0 gcc 4.8 GDB 7.6.1 Qt 5.2.0 Ubuntu 13.10 

Is this feature supported?

+7
c ++ debugging qt gdb qt-creator
source share
2 answers
+1
source share

In addition to installing the Python libstdC ++ printers from https://sourceware.org/gdb/wiki/STLSupport, you must also fix them for Ubuntu 13.10.

You must apply this patch http://patchwork.ozlabs.org/patch/287368/ to make them work. See also this answer https://stackoverflow.com/a/318618/

+1
source share

All Articles