Commit 9ce8bcd1 authored by hjk's avatar hjk

Debugger: Simplify display of std::shared_ptr<Foo>

Change-Id: Ie2145903f9ac303d88455cfd609f55240aa76a67
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 6d72796e
......@@ -818,6 +818,11 @@ QString simplifySTLType(const QString &typeIn)
&& type.endsWith(QLatin1String(">::element_type")))
type = type.mid(18, type.size() - 33);
// std::shared_ptr<...>::element_type
if (type.startsWith(QLatin1String("std::shared_ptr<"))
&& type.endsWith(QLatin1String(">::element_type")))
type = type.mid(16, type.size() - 31);
// std::ifstream
QRegExp ifstreamRE(QLatin1String("std::basic_ifstream<char,\\s*std::char_traits<char>\\s*>"));
ifstreamRE.setMinimal(true);
......
......@@ -3034,11 +3034,9 @@ void tst_Dumpers::dumper_data()
% Cxx11Profile()
% MacLibCppProfile()
% Check("pi", Pointer("32"), "std::shared_ptr<int>")
% Check("pi.data", "32", "int").setForGdbOnly()
% Check("pi.data", "32", "std::shared_ptr<int>::element_type").setForLldbOnly()
% Check("pi.data", "32", "int")
% Check("pf", Pointer(), "std::shared_ptr<Foo>")
% CheckType("pf.data", "Foo").setForGdbOnly()
% CheckType("pf.data", "std::shared_ptr<Foo>::element_type").setForLldbOnly();
% CheckType("pf.data", "Foo");
QTest::newRow("StdSetInt")
<< Data("#include <set>\n",
......
......@@ -60,6 +60,7 @@ const char *description[] =
"msvc_wstringvector",
"boost_shared_ptr",
"std_shared_ptr",
};
const char *input[] =
......@@ -90,6 +91,8 @@ const char *input[] =
"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",
// std
"std::shared_ptr<int>::element_type",
};
const char *output[] =
......@@ -118,6 +121,8 @@ const char *output[] =
"std::vector<std::wstring>",
// boost
"int",
// std
"int",
};
class SimplifyTypesTest : public QObject
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment