forked from qt-creator/qt-creator
Debugger: Remove boost::shared_ptr<>::element_type noise from display
Change-Id: Ic520cadc41463e679b324028b6126ad3f4138c34 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user