diff --git a/share/qtcreator/dumper/dumper.py b/share/qtcreator/dumper/dumper.py index d2dcf158be8..5b3d7b4e8d9 100644 --- a/share/qtcreator/dumper/dumper.py +++ b/share/qtcreator/dumper/dumper.py @@ -1546,24 +1546,30 @@ class Dumper: self.putType(typeName) self.putNumChild(1) format = self.currentItemFormat() - if format == None and str(targetType.unqualified()) == "char": + isDefault = format == None and str(targetType.unqualified()) == "char" + if isDefault or (format >= 0 and format <= 2): + blob = readRawMemory(value.address, type.sizeof) + + if isDefault: # Use Latin1 as default for char []. - self.putValue(encodeCharArray(value), Hex2EncodedLatin1) + self.putValue(blob, Hex2EncodedLatin1) elif format == 0: # Explicitly requested Latin1 formatting. - self.putValue(encodeCharArray(value), Hex2EncodedLatin1) + self.putValue(blob, Hex2EncodedLatin1) elif format == 1: # Explicitly requested UTF-8 formatting. - self.putValue(encodeCharArray(value), Hex2EncodedUtf8) + self.putValue(blob, Hex2EncodedUtf8) elif format == 2: # Explicitly requested Local 8-bit formatting. - self.putValue(encodeCharArray(value), Hex2EncodedLocal8Bit) + self.putValue(blob, Hex2EncodedLocal8Bit) else: self.putValue("@0x%x" % long(value.cast(targetType.pointer()))) + + if self.currentIName in self.expandedINames: - p = value.cast(targetType.pointer()) + p = value.address ts = targetType.sizeof - if not self.tryPutArrayContents(targetType, p, type.sizeof/ts): + if not self.tryPutArrayContents(targetType, p, type.sizeof / ts): with Children(self, childType=targetType, addrBase=p, addrStep=ts): self.putFields(value) diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index dea97a0034c..5b1a45bc597 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -4486,6 +4486,31 @@ namespace namespc { } // namespace namespc +namespace gccextensions { + + void testGccExtensions() + { +#ifdef __GNUC__ + char v[8] = { 1, 2 }; + char w __attribute__ ((vector_size (8))) = { 1, 2 }; + int y[2] = { 1, 2 }; + int z __attribute__ ((vector_size (8))) = { 1, 2 }; + BREAK_HERE; + // Expand v. + // Check v.0 1 char. + // Check v.1 2 char. + // Check w.0 1 char. + // Check w.1 2 char. + // Check y.0 1 int. + // Check y.1 2 int. + // Check z.0 1 int. + // Check z.1 2 int. + // Continue. + dummyStatement(&v, &w, &y, &z); +#endif + } + +} // namespace gccextension class Z : public QObject { @@ -6566,6 +6591,7 @@ int main(int argc, char *argv[]) // Check for normal dumpers. basic::testBasic(); + gccextensions::testGccExtensions(); qhostaddress::testQHostAddress(); varargs::testVaList();