diff --git a/bin/gdbmacros/gdbmacros.cpp b/bin/gdbmacros/gdbmacros.cpp
index abca7066ee47dca53503fe4799810a4c3537b397..9ea2a9aff56749af04c68e2572a8ea5e5fc31079 100644
--- a/bin/gdbmacros/gdbmacros.cpp
+++ b/bin/gdbmacros/gdbmacros.cpp
@@ -661,11 +661,8 @@ void QDumper::endHash()
 
 void QDumper::putEllipsis()
 {
-    d.beginHash();
-    P(d, "name", "Warning:");
-    P(d, "value", "<incomplete>");
-    P(d, "type", d.innertype);
-    d.endHash();
+    addCommaIfNeeded();
+    *this << "{name=\"<incomplete>\",value=\"\",type=\"" << innertype << "\"}";
 }
 
 //
@@ -2120,7 +2117,7 @@ static void qDumpStdList(QDumper &d)
 
     int nn = 0;
     std::list<int>::const_iterator it = list.begin();
-    for (nn < 101 && it != list.end(); ++nn, ++it)
+    for (; nn < 101 && it != list.end(); ++nn, ++it)
         qCheckAccess(it.operator->());
 
     if (nn > 100)
@@ -2135,7 +2132,7 @@ static void qDumpStdList(QDumper &d)
         const char *stripped =
             isPointerType(d.innertype) ? strippedInnerType.data() : 0;
         d << ",children=[";
-        std::list<int>::const_iterator it = list.begin();
+        it = list.begin();
         for (int i = 0; i < 1000 && it != list.end(); ++i, ++it) {
             d.beginHash();
             P(d, "name", "[" << i << "]");
diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp
index 35933ec5a209bba2e51e818c918c17f5dab404b4..dbc7eebcd3cf2f87c4a6b81618595d8089912ee7 100644
--- a/tests/manual/gdbdebugger/simple/app.cpp
+++ b/tests/manual/gdbdebugger/simple/app.cpp
@@ -73,6 +73,9 @@ uint qHash(const double & f)
     return int(f);
 }
 
+#define X myns
+X::QString str;
+
 class  Foo
 {
 public:
@@ -623,6 +626,8 @@ void testQVariant3()
 
 void testQVector()
 {
+    QVector<int> big(10000);
+
     QVector<Foo *> plist;
     plist.append(new Foo(1));
     plist.append(0);