diff --git a/share/qtcreator/debugger/boosttypes.py b/share/qtcreator/debugger/boosttypes.py index 778bbf14290..fb725c4f226 100644 --- a/share/qtcreator/debugger/boosttypes.py +++ b/share/qtcreator/debugger/boosttypes.py @@ -75,7 +75,12 @@ def qdump__boost__shared_ptr(d, value): d.check(usecount <= 10*1000*1000) val = value["px"].dereference() - if d.isSimpleType(val.type): + type = val.type + # handle boost::shared_ptr::element_type as int + if str(type).endswith(">::element_type"): + type = type.strip_typedefs() + + if d.isSimpleType(type): d.putNumChild(3) d.putItem(val) d.putBetterType(value.type) diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 5423c81f036..7a79cec50ef 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -813,6 +813,11 @@ QString simplifySTLType(const QString &typeIn) type.replace(QLatin1Char('*'), QLatin1Char('@')); for (int i = 0; i < 10; ++i) { + // boost::shared_ptr<...>::element_type + if (type.startsWith(QLatin1String("boost::shared_ptr<")) + && type.endsWith(QLatin1String(">::element_type"))) + type = type.mid(18, type.size() - 33); + // std::ifstream QRegExp ifstreamRE(QLatin1String("std::basic_ifstream\\s*>")); ifstreamRE.setMinimal(true); diff --git a/tests/auto/debugger/tst_simplifytypes.cpp b/tests/auto/debugger/tst_simplifytypes.cpp index 056be1ee07a..bbf99e1e04e 100644 --- a/tests/auto/debugger/tst_simplifytypes.cpp +++ b/tests/auto/debugger/tst_simplifytypes.cpp @@ -47,7 +47,9 @@ const char *description[] = "g++_wstringvector", "g++_unordered_set", "g++_unordered_map", + "libc++_stringvector", + "msvc_stdstring", "msvc_stdwstring", "msvc_stringmap", @@ -56,6 +58,8 @@ const char *description[] = "msvc_stringset", "msvc_stringvector", "msvc_wstringvector", + + "boost_shared_ptr", }; const char *input[] = @@ -83,7 +87,9 @@ const char *input[] = "class std::list,std::allocator >,std::allocator,std::allocator > > >", "class std::set,std::allocator >,std::less,std::allocator > >,std::allocator,std::allocator > > >", "class std::vector,std::allocator >,std::allocator,std::allocator > > >", -"class std::vector,std::allocator >,std::allocator,std::allocator > > >" +"class std::vector,std::allocator >,std::allocator,std::allocator > > >", +// boost +"boost::shared_ptr::element_type", }; const char *output[] = @@ -110,6 +116,8 @@ const char *output[] = "std::set", "std::vector", "std::vector", + // boost + "int", }; class SimplifyTypesTest : public QObject