diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py index fc146963843d90398ab8d7bf653c11e484f4f83f..ed6feb7da0aac5df1a07360234a9a129e3a3946c 100644 --- a/share/qtcreator/gdbmacros/dumper.py +++ b/share/qtcreator/gdbmacros/dumper.py @@ -210,7 +210,7 @@ class SubItem: if len(type) > 0 and type != self.d.currentChildType: self.d.put('type="%s",' % type) # str(type.unqualified()) ? if not self.d.currentValueEncoding is None: - self.d.put('valueencoded="%d",', self.d.currentValueEncoding) + self.d.put('valueencoded="%d",' % self.d.currentValueEncoding) if not self.d.currentValue is None: self.d.put('value="%s",' % self.d.currentValue) except: @@ -1106,7 +1106,7 @@ class Dumper: def childRange(self): return xrange(qmin(self.currentMaxNumChilds, self.currentNumChilds)) - # convenience + # Convenience function. def putItemCount(self, count): # This needs to override the default value, so don't use 'put' directly. self.putValue('<%s items>' % count) @@ -1129,7 +1129,7 @@ class Dumper: self.put('numchild="%s",' % numchild) def putValue(self, value, encoding = None, priority = 0): - # higher priority values override lower ones + # Higher priority values override lower ones. if priority >= self.currentValuePriority: self.currentValue = value self.currentValuePriority = priority @@ -1155,7 +1155,7 @@ class Dumper: def putByteArrayValue(self, value): str = encodeByteArray(value) - self.put('valueencoded="%d",value="%s",' % (Hex2EncodedLatin1, str)) + self.putValue(str, Hex2EncodedLatin1) def putName(self, name): self.put('name="%s",' % name) @@ -1341,7 +1341,7 @@ class Dumper: isHandled = True target = stripTypedefs(type.target()) - if (not isHandled) and target.code == TYPE_CODE_VOID: + if (not isHandled) and target.code == gdb.TYPE_CODE_VOID: self.putType(item.value.type) self.putValue(str(value)) self.putNumChild(0) @@ -1463,7 +1463,7 @@ class Dumper: item.iname, "@%d" % baseNumber, field.name) baseNumber += 1 with SubItem(self): - self.put('iname="%s",', child.iname) + self.put('iname="%s",' % child.iname) self.putItemHelper(child) elif len(field.name) == 0: # Anonymous union. We need a dummy name to distinguish diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index 6eb30b48bd1e408b459cf2fc906a2c22d0208941..db880e4b2a32a52c5add9d848b25df3b24aa28f9 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -227,11 +227,13 @@ void testArray() d[i][j] = i + j; #endif +#if 1 char c[20]; c[0] = 'a'; c[1] = 'b'; c[2] = 'c'; c[3] = 'd'; +#endif #if 1 QString s[20]; @@ -239,7 +241,17 @@ void testArray() s[1] = "b"; s[2] = "c"; s[3] = "d"; +#endif +#if 1 + QByteArray b[20]; + b[0] = "a"; + b[1] = "b"; + b[2] = "c"; + b[3] = "d"; +#endif + +#if 1 Foo foo[10]; //for (int i = 0; i != sizeof(foo)/sizeof(foo[0]); ++i) { for (int i = 0; i < 5; ++i) {