diff options
author | hjk <hjk121@nokiamail.com> | 2014-01-08 17:48:53 +0100 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-01-08 18:17:10 +0100 |
commit | b72085ea8597f7653cca6d894be2a543ae19789e (patch) | |
tree | 796a496eadd4a3cf6de01f9c329c52cc594afb7e | |
parent | 8361ade08d04cf222fabf9a93d7e6f8f9ca87684 (diff) | |
download | qt-creator-b72085ea8597f7653cca6d894be2a543ae19789e.tar.gz |
Debugger: Remove boost::shared_ptr<>::element_type noise from display
Change-Id: Ic520cadc41463e679b324028b6126ad3f4138c34
Reviewed-by: hjk <hjk121@nokiamail.com>
-rw-r--r-- | share/qtcreator/debugger/boosttypes.py | 7 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerprotocol.cpp | 5 | ||||
-rw-r--r-- | tests/auto/debugger/tst_simplifytypes.cpp | 10 |
3 files changed, 20 insertions, 2 deletions
diff --git a/share/qtcreator/debugger/boosttypes.py b/share/qtcreator/debugger/boosttypes.py index 778bbf1429..fb725c4f22 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<int>::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 5423c81f03..7a79cec50e 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<char,\\s*std::char_traits<char>\\s*>")); ifstreamRE.setMinimal(true); diff --git a/tests/auto/debugger/tst_simplifytypes.cpp b/tests/auto/debugger/tst_simplifytypes.cpp index 056be1ee07..bbf99e1e04 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::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >", "class std::set<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >", "class std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >", -"class std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >" +"class std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > > >", +// boost +"boost::shared_ptr<int>::element_type", }; const char *output[] = @@ -110,6 +116,8 @@ const char *output[] = "std::set<std::string>", "std::vector<std::string>", "std::vector<std::wstring>", + // boost + "int", }; class SimplifyTypesTest : public QObject |