forked from qt-creator/qt-creator
Debugger: Handle char const* and const char* the same in types
Helps recognition of default std::maps and makes the StdMapQt dumper test pass with LLDB on Linux Change-Id: I2d2a91d65e895c7fc2c99e24cc77d21ca6353b22 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "simplifytype.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QRegExp>
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -131,6 +132,9 @@ QString simplifyType(const QString &typeIn)
|
||||
type.replace(QLatin1String(" *"), QLatin1String("@"));
|
||||
type.replace(QLatin1Char('*'), QLatin1Char('@'));
|
||||
|
||||
// Normalize char const * and const char *.
|
||||
type.replace(QLatin1String("char const@"), QLatin1String("const char@"));
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
// boost::shared_ptr<...>::element_type
|
||||
if (type.startsWith(QLatin1String("boost::shared_ptr<"))
|
||||
|
@@ -49,6 +49,7 @@ const char *description[] =
|
||||
"g++_unordered_set",
|
||||
"g++_unordered_map",
|
||||
"g++_stdvector_int_ptr",
|
||||
"g++_stdmap_char_ptr",
|
||||
|
||||
"libc++_stringvector",
|
||||
"libc++_unordered_map",
|
||||
@@ -83,7 +84,9 @@ 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*> >",
|
||||
"std::map<const char *, Foo, std::less<const char *>, std::allocator<std::pair<char const* const, Foo> > >",
|
||||
|
||||
// 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> > > >",
|
||||
@@ -122,6 +125,7 @@ const char *output[] =
|
||||
"std::unordered_set<int>",
|
||||
"std::unordered_map<int, int>",
|
||||
"std::vector<int *>",
|
||||
"std::map<const char *, Foo>",
|
||||
// libc++
|
||||
"std::vector<std::string>",
|
||||
"std::unordered_map<std::string, float>",
|
||||
|
Reference in New Issue
Block a user