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,24 +1546,30 @@ class Dumper:
|
|||||||
self.putType(typeName)
|
self.putType(typeName)
|
||||||
self.putNumChild(1)
|
self.putNumChild(1)
|
||||||
format = self.currentItemFormat()
|
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 [].
|
# Use Latin1 as default for char [].
|
||||||
self.putValue(encodeCharArray(value), Hex2EncodedLatin1)
|
self.putValue(blob, Hex2EncodedLatin1)
|
||||||
elif format == 0:
|
elif format == 0:
|
||||||
# Explicitly requested Latin1 formatting.
|
# Explicitly requested Latin1 formatting.
|
||||||
self.putValue(encodeCharArray(value), Hex2EncodedLatin1)
|
self.putValue(blob, Hex2EncodedLatin1)
|
||||||
elif format == 1:
|
elif format == 1:
|
||||||
# Explicitly requested UTF-8 formatting.
|
# Explicitly requested UTF-8 formatting.
|
||||||
self.putValue(encodeCharArray(value), Hex2EncodedUtf8)
|
self.putValue(blob, Hex2EncodedUtf8)
|
||||||
elif format == 2:
|
elif format == 2:
|
||||||
# Explicitly requested Local 8-bit formatting.
|
# Explicitly requested Local 8-bit formatting.
|
||||||
self.putValue(encodeCharArray(value), Hex2EncodedLocal8Bit)
|
self.putValue(blob, Hex2EncodedLocal8Bit)
|
||||||
else:
|
else:
|
||||||
self.putValue("@0x%x" % long(value.cast(targetType.pointer())))
|
self.putValue("@0x%x" % long(value.cast(targetType.pointer())))
|
||||||
|
|
||||||
|
|
||||||
if self.currentIName in self.expandedINames:
|
if self.currentIName in self.expandedINames:
|
||||||
p = value.cast(targetType.pointer())
|
p = value.address
|
||||||
ts = targetType.sizeof
|
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,
|
with Children(self, childType=targetType,
|
||||||
addrBase=p, addrStep=ts):
|
addrBase=p, addrStep=ts):
|
||||||
self.putFields(value)
|
self.putFields(value)
|
||||||
|
@@ -4486,6 +4486,31 @@ namespace namespc {
|
|||||||
} // 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
|
class Z : public QObject
|
||||||
{
|
{
|
||||||
@@ -6566,6 +6591,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Check for normal dumpers.
|
// Check for normal dumpers.
|
||||||
basic::testBasic();
|
basic::testBasic();
|
||||||
|
gccextensions::testGccExtensions();
|
||||||
qhostaddress::testQHostAddress();
|
qhostaddress::testQHostAddress();
|
||||||
varargs::testVaList();
|
varargs::testVaList();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user