From aee5668b623eb9040378ddd20a3ebed118fc7cd5 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 15 Apr 2015 14:33:20 +0200 Subject: [PATCH] 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 --- src/plugins/debugger/simplifytype.cpp | 4 ++++ tests/auto/debugger/tst_simplifytypes.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/debugger/simplifytype.cpp b/src/plugins/debugger/simplifytype.cpp index 2ecfd235ce8..c4012b173cb 100644 --- a/src/plugins/debugger/simplifytype.cpp +++ b/src/plugins/debugger/simplifytype.cpp @@ -30,6 +30,7 @@ #include "simplifytype.h" +#include #include #include @@ -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<")) diff --git a/tests/auto/debugger/tst_simplifytypes.cpp b/tests/auto/debugger/tst_simplifytypes.cpp index 495c09ae4c2..2251e8ca5ea 100644 --- a/tests/auto/debugger/tst_simplifytypes.cpp +++ b/tests/auto/debugger/tst_simplifytypes.cpp @@ -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, std::equal_to, std::allocator >", "std::unordered_map, std::equal_to, std::allocator > >", + "std::vector >", +"std::map, std::allocator > >", // libc++ "std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > >", @@ -122,6 +125,7 @@ const char *output[] = "std::unordered_set", "std::unordered_map", "std::vector", + "std::map", // libc++ "std::vector", "std::unordered_map",