forked from qt-creator/qt-creator
debugger: fix display of gcc's built-in vector types
Change-Id: I293be4f5c207828c64de30236a25f6c0062346b8 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -1546,22 +1546,28 @@ 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):
|
||||
with Children(self, childType=targetType,
|
||||
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user