Commit 9f1d8b66 authored by hjk's avatar hjk
Browse files

debugger: fix display of gcc's built-in vector types



Change-Id: I293be4f5c207828c64de30236a25f6c0062346b8
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent d45716a8
......@@ -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)
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment