Commit 53bd2e2e authored by hjk's avatar hjk

Debugger: Improve normalization of types containing pointers

Always add a space before a *. This fixes some test cases with LLDB
that failed to recognize the default argument in "std::vector<int *,
std::allocator<int*> >" due to the different spacing.

Change-Id: Ib4a57a808551d0b4cd527021f7d19772378e405f
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent e33da6a6
......@@ -126,6 +126,9 @@ QString simplifyType(const QString &typeIn)
type.replace(QLatin1String("std::__debug::"), QLatin1String("std::"));
QRegExp simpleStringRE(QString::fromLatin1("std::basic_string<char> ?"));
type.replace(simpleStringRE, QLatin1String("std::string"));
// Normalize space + ptr.
type.replace(QLatin1String(" *"), QLatin1String("@"));
type.replace(QLatin1Char('*'), QLatin1Char('@'));
for (int i = 0; i < 10; ++i) {
......@@ -303,7 +306,7 @@ QString simplifyType(const QString &typeIn)
}
} // with std::allocator
}
type.replace(QLatin1Char('@'), QLatin1Char('*'));
type.replace(QLatin1Char('@'), QLatin1String(" *"));
type.replace(QLatin1String(" >"), QLatin1String(">"));
return type;
}
......
......@@ -48,6 +48,7 @@ const char *description[] =
"g++_wstringvector",
"g++_unordered_set",
"g++_unordered_map",
"g++_stdvector_int_ptr",
"libc++_stringvector",
"libc++_unordered_map",
......@@ -82,6 +83,7 @@ const char *input[] =
"std::unordered_set<int, std::hash<int>, std::equal_to<int>, std::allocator<int> >",
"std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, int> > >",
"std::vector<int *, std::allocator<int*> >",
// libc++
"std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >",
......@@ -119,6 +121,7 @@ const char *output[] =
"std::vector<std::wstring>",
"std::unordered_set<int>",
"std::unordered_map<int, int>",
"std::vector<int *>",
// libc++
"std::vector<std::string>",
"std::unordered_map<std::string, float>",
......
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