aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgoro <qtc-committer@nokia.com>2008-12-11 16:19:19 +0100
committergoro <qtc-committer@nokia.com>2008-12-11 16:19:19 +0100
commitd72b49949d4d79f72e1d6851dc0a303ef72af350 (patch)
tree17e2ee12d30f284efdf534c24f0ef768ff6f304d
parent0c20f6d9d154e181feabb21218be15e4348cda04 (diff)
parent0104dd4173783ae36140406be7b30ed3079a4443 (diff)
Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta
-rw-r--r--src/plugins/debugger/watchhandler.cpp15
-rw-r--r--tests/manual/gdbdebugger/simple/app.cpp39
2 files changed, 50 insertions, 4 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 6f443c92b47..5328a171aea 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -411,7 +411,7 @@ static QString niceType(QString type)
"std::allocator<wchar_t> >", "std::wstring");
// std::vector
- static QRegExp re1("std::vector<(.*)\\s*,std::allocator<(.*)>\\s*>");
+ static QRegExp re1("std::vector<(.*), std::allocator<(.*)>\\s*>");
re1.setMinimal(true);
for (int i = 0; i != 10; ++i) {
if (re1.indexIn(type) == -1 || re1.cap(1) != re1.cap(2))
@@ -420,7 +420,7 @@ static QString niceType(QString type)
}
// std::list
- static QRegExp re2("std::list<(.*)\\s*,std::allocator<(.*)>\\s*>");
+ static QRegExp re2("std::list<(.*), std::allocator<(.*)>\\s*>");
re2.setMinimal(true);
for (int i = 0; i != 10; ++i) {
if (re2.indexIn(type) == -1 || re2.cap(1) != re2.cap(2))
@@ -428,6 +428,17 @@ static QString niceType(QString type)
type.replace(re2.cap(0), "std::list<" + re2.cap(1) + ">");
}
+ // std::map
+ static QRegExp re3("std::map<(.*), (.*), std::less<(.*)\\s*>, "
+ "std::allocator<std::pair<const (.*), (.*)\\s*> > >");
+ re3.setMinimal(true);
+ for (int i = 0; i != 10; ++i) {
+ if (re3.indexIn(type) == -1 || re3.cap(1) != re3.cap(3)
+ || re3.cap(1) != re3.cap(4) || re3.cap(2) != re3.cap(5))
+ break;
+ type.replace(re3.cap(0), "std::map<" + re3.cap(1) + ", " + re3.cap(2) + ">");
+ }
+
type.replace(" >", ">");
}
return type;
diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp
index dbc7eebcd3c..ab5ee635b5a 100644
--- a/tests/manual/gdbdebugger/simple/app.cpp
+++ b/tests/manual/gdbdebugger/simple/app.cpp
@@ -53,6 +53,7 @@
#include <QtNetwork/QHostAddress>
#include <iostream>
+#include <map>
#include <list>
#include <stack>
#include <string>
@@ -131,7 +132,6 @@ void testArray()
}
}
-
void testQByteArray()
{
QByteArray ba = "Hello";
@@ -142,7 +142,6 @@ void testQByteArray()
ba += 2;
}
-
void testQHash()
{
QHash<int, float> hgg0;
@@ -412,6 +411,41 @@ void testStdList()
vec.push_back(false);
}
+void testStdMap()
+{
+ std::map<uint, QStringList> ggl;
+ ggl[11] = QStringList() << "11";
+ ggl[22] = QStringList() << "22";
+
+ typedef std::map<uint, QStringList> T;
+ T ggt;
+ ggt[11] = QStringList() << "11";
+ ggt[22] = QStringList() << "22";
+
+#if 0
+ std::map<uint, float> gg0;
+ gg0[11] = 11.0;
+ gg0[22] = 22.0;
+
+
+ std::map<QString, float> gg1;
+ gg1["22.0"] = 22.0;
+
+ std::map<int, QString> gg2;
+ gg2[22] = "22.0";
+
+ std::map<QString, Foo> gg3;
+ gg3["22.0"] = Foo(22);
+ gg3["33.0"] = Foo(33);
+
+ QObject ob;
+ std::map<QString, QPointer<QObject> > map;
+ map.insert("Hallo", QPointer<QObject>(&ob));
+ map.insert("Welt", QPointer<QObject>(&ob));
+ map.insert(".", QPointer<QObject>(&ob));
+#endif
+}
+
void testStdStack()
{
std::stack<int *> plist1;
@@ -795,6 +829,7 @@ int main(int argc, char *argv[])
testArray();
testStdList();
+ testStdMap();
testStdStack();
testStdString();
testStdVector();