aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-11-30 15:25:30 +0100
committerhjk <hjk@qt.io>2020-12-01 14:59:06 +0000
commite1790ed9d0c029f19981208e02d35d0520439ec9 (patch)
tree23a5fb67a78f0f5035a3f586da88443fe7bf9058
parentcfacbb773be7151d9e7b7df2f2ae946ab476e372 (diff)
Debugger: Fix some dumpers with namespaced Qtv4.14.0-rc1
This makes the use of '@' prefixes in split('{@QString}'...) etc mandatory, thereby removing the guessing on whether namespaces apply or not on the dumper 'core' side, and removes the guessing on whether dropping the '@' 'works' on the individual dumper implementation side. Amends 1074c2ffce. Change-Id: I44611eb09557638dec12d2e2f78cdaeac0bbd449 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--share/qtcreator/debugger/dumper.py6
-rw-r--r--share/qtcreator/debugger/qttypes.py78
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp10
3 files changed, 47 insertions, 47 deletions
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py
index b682f4ae00..1da2b3a550 100644
--- a/share/qtcreator/debugger/dumper.py
+++ b/share/qtcreator/debugger/dumper.py
@@ -1902,7 +1902,7 @@ class DumperBase():
= self.split('ppppIIp' + 'pppppp', dd)
if qobjectPtr:
- qobjectType = self.createType('QObject')
+ qobjectType = self.createType('@QObject')
with SubItem(self, '[parent]'):
if not self.isCli:
self.putSortGroup(9)
@@ -2063,8 +2063,8 @@ class DumperBase():
# Dynamic properties.
if extraData:
- byteArrayType = self.createType('QByteArray')
- variantType = self.createType('QVariant')
+ byteArrayType = self.createType('@QByteArray')
+ variantType = self.createType('@QVariant')
if self.qtVersion() >= 0x50600:
values = self.vectorChildrenGenerator(
extraData + 2 * ptrSize, variantType)
diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py
index 74314d7f1c..f1c432ce64 100644
--- a/share/qtcreator/debugger/qttypes.py
+++ b/share/qtcreator/debugger/qttypes.py
@@ -243,7 +243,7 @@ def qdump__Qt__ItemDataRole(d, value):
def qdump__QStandardItemData(d, value):
- role, pad, val = value.split('{@Qt::ItemDataRole}@{QVariant}')
+ role, pad, val = value.split('{@Qt::ItemDataRole}@{@QVariant}')
d.putPairContents(role.value(), (role, val), 'role', 'value')
@@ -573,7 +573,7 @@ def qdump__QKeyEvent(d, value):
# ushort reserved:15;
(vtable, privateD, t, flags, modState, ts, txt, k, scanCode,
virtualKey, modifiers,
- c, autor) = value.split("ppHHiQ{QString}{int}IIIHH")
+ c, autor) = value.split("ppHHiQ{@QString}{int}IIIHH")
#d.putStringValue(txt)
#data = d.encodeString(txt)
@@ -823,7 +823,7 @@ def qdump__QHash(d, value):
def qdump__QVariantHash(d, value):
- qdumpHelper_QHash(d, value, d.createType('QString'), d.createType('QVariant'))
+ qdumpHelper_QHash(d, value, d.createType('@QString'), d.createType('@QVariant'))
def qdumpHelper_QHash(d, value, keyType, valueType):
@@ -969,29 +969,29 @@ def qdump__QHostAddress(d, value):
if tiVersion is not None:
if tiVersion >= 16:
# After a6cdfacf
- p, scopeId, a6, a4, protocol = d.split('p{QString}16s{quint32}B', dd)
+ p, scopeId, a6, a4, protocol = d.split('p{@QString}16s{@quint32}B', dd)
mayNeedParse = False
elif tiVersion >= 5:
# Branch 5.8.0 at f70b4a13 TI: 15
# Branch 5.7.0 at b6cf0418 TI: 5
(ipString, scopeId, a6, a4, protocol, isParsed) \
- = d.split('{QString}{QString}16s{quint32}B{bool}', dd)
+ = d.split('{@QString}{@QString}16s{@quint32}B{bool}', dd)
else:
(ipString, scopeId, a4, pad, a6, protocol, isParsed) \
- = d.split('{QString}{QString}{quint32}I16sI{bool}', dd)
+ = d.split('{@QString}{@QString}{@quint32}I16sI{bool}', dd)
elif qtVersion >= 0x050600: # 5.6.0 at f3aabb42
if d.ptrSize() == 8 or d.isWindowsTarget():
(ipString, scopeId, a4, pad, a6, protocol, isParsed) \
- = d.split('{QString}{QString}{quint32}I16sI{bool}', dd)
+ = d.split('{@QString}{@QString}{@quint32}I16sI{bool}', dd)
else:
(ipString, scopeId, a4, a6, protocol, isParsed) \
- = d.split('{QString}{QString}{quint32}16sI{bool}', dd)
+ = d.split('{@QString}{@QString}{@quint32}16sI{bool}', dd)
elif qtVersion >= 0x050000: # 5.2.0 at 62feb088
(ipString, scopeId, a4, a6, protocol, isParsed) \
- = d.split('{QString}{QString}{quint32}16sI{bool}', dd)
+ = d.split('{@QString}{@QString}{@quint32}16sI{bool}', dd)
else: # 4.8.7 at b05d05f
(a4, a6, protocol, pad, ipString, isParsed, pad, scopeId) \
- = d.split('{quint32}16sB@{QString}{bool}@{QString}', dd)
+ = d.split('{@quint32}16sB@{@QString}{bool}@{@QString}', dd)
if mayNeedParse:
ipStringData, ipStringSize, ipStringAlloc = d.stringData(ipString)
@@ -1044,7 +1044,7 @@ def qdump__QList(d, value):
def qdump__QVariantList(d, value):
- qdumpHelper_QList(d, value, d.createType('QVariant'))
+ qdumpHelper_QList(d, value, d.createType('@QVariant'))
def qdumpHelper_QList(d, value, innerType):
@@ -1186,8 +1186,8 @@ def qdump__QLocale(d, value):
decimal, group, listt, percent, zero,
minus, plus, exponential) \
= d.split('2s{short}2s'
- + '{QChar}{QChar}{short}{QChar}{QChar}'
- + '{QChar}{QChar}{QChar}', data)
+ + '{@QChar}{@QChar}{short}{@QChar}{@QChar}'
+ + '{@QChar}{@QChar}{@QChar}', data)
try:
d.putStringValue(d.call('const char *', value, 'name'))
except:
@@ -1325,7 +1325,7 @@ def qform__QVariantMap():
def qdump__QVariantMap(d, value):
- qdumpHelper_QMap(d, value, d.createType('QString'), d.createType('QVariant'))
+ qdumpHelper_QMap(d, value, d.createType('@QString'), d.createType('@QVariant'))
def qdump__QMetaMethod(d, value):
@@ -1428,7 +1428,7 @@ def qdump__QRectF(d, value):
def qdump__QRegExp(d, value):
# value.priv.engineKey.pattern
privAddress = d.extractPointer(value)
- (eng, pattern) = d.split('p{QString}', privAddress)
+ (eng, pattern) = d.split('p{@QString}', privAddress)
d.putStringValue(pattern)
d.putExpandable()
if d.isExpanded():
@@ -1439,7 +1439,7 @@ def qdump__QRegExp(d, value):
# Might fail (LLDB, Core files, ...), still cache might be warm.
pass
(patternSyntax, caseSensitive, minimal, pad, t, captures) \
- = d.split('{int}{int}B@{QString}{QStringList}', privAddress + 2 * d.ptrSize())
+ = d.split('{int}{int}B@{@QString}{@QStringList}', privAddress + 2 * d.ptrSize())
d.putSubItem('syntax', patternSyntax.cast(d.qtNamespace() + 'QRegExp::PatternSyntax'))
d.putSubItem('captures', captures)
@@ -1452,15 +1452,15 @@ def qdump__QRegion(d, value):
if d.qtVersion() >= 0x060000:
ref, _, rgn = d.split('i@p', d_ptr)
numRects, innerArea, rects, extents, innerRect = \
- d.split('ii{QList<QRect>}{QRect}{QRect}', rgn)
+ d.split('ii{@QList<@QRect>}{@QRect}{@QRect}', rgn)
elif d.qtVersion() >= 0x050400: # Padding removed in ee324e4ed
ref, _, rgn = d.split('i@p', d_ptr)
numRects, innerArea, rects, extents, innerRect = \
- d.split('ii{QVector<QRect>}{QRect}{QRect}', rgn)
+ d.split('ii{@QVector<@QRect>}{@QRect}{@QRect}', rgn)
elif d.qtVersion() >= 0x050000:
ref, _, rgn = d.split('i@p', d_ptr)
numRects, _, rects, extents, innerRect, innerArea = \
- d.split('i@{QVector<QRect>}{QRect}{QRect}i', rgn)
+ d.split('i@{@QVector<@QRect>}{@QRect}{@QRect}i', rgn)
else:
if d.isWindowsTarget():
ref, _, rgn = d.split('i@p', d_ptr)
@@ -1470,7 +1470,7 @@ def qdump__QRegion(d, value):
numRects = 0
else:
numRects, _, rects, extents, innerRect, innerArea = \
- d.split('i@{QVector<QRect>}{QRect}{QRect}i', rgn)
+ d.split('i@{@QVector<@QRect>}{@QRect}{@QRect}i', rgn)
d.putItemCount(numRects)
if d.isExpanded():
@@ -1619,13 +1619,13 @@ def qdump__QStack(d, value):
def qdump__QPolygonF(d, value):
data, size, _ = d.vectorData(value)
d.putItemCount(size)
- d.putPlotData(data, size, d.createType('QPointF'))
+ d.putPlotData(data, size, d.createType('@QPointF'))
def qdump__QPolygon(d, value):
data, size, _ = d.vectorData(value)
d.putItemCount(size)
- d.putPlotData(data, size, d.createType('QPoint'))
+ d.putPlotData(data, size, d.createType('@QPoint'))
def qdump__QGraphicsPolygonItem(d, value):
@@ -1639,7 +1639,7 @@ def qdump__QGraphicsPolygonItem(d, value):
offset = 308
data, size, alloc = d.vectorData(dptr + offset)
d.putItemCount(size)
- d.putPlotData(data, size, d.createType('QPointF'))
+ d.putPlotData(data, size, d.createType('@QPointF'))
def qedit__QString(d, value, data):
@@ -1661,7 +1661,7 @@ def qdump__QString(d, value):
if (size > 0):
d.putExpandable()
if d.isExpanded():
- d.putArrayData(data, size, d.createType('QChar'))
+ d.putArrayData(data, size, d.createType('@QChar'))
def qdump__QStaticStringData(d, value):
@@ -1701,13 +1701,13 @@ def qdump__QStringRef(d, value):
if stringptr == 0:
d.putValue('(null)')
return
- (data, ssize, alloc) = d.stringData(d.createValue(stringptr, 'QString'))
+ data, ssize, alloc = d.stringData(d.createValue(stringptr, '@QString'))
d.putValue(d.readMemory(data + 2 * pos, 2 * size), 'utf16')
d.putPlainChildren(value)
def qdump__QStringList(d, value):
- qdumpHelper_QList(d, value, d.createType('QString'))
+ qdumpHelper_QList(d, value, d.createType('@QString'))
d.putBetterType(value.type)
@@ -1770,8 +1770,8 @@ def qdump__QUrl(d, value):
if d.qtVersion() < 0x050000:
d.call('void', value, 'port') # Warm up internal cache.
d.call('void', value, 'path')
- st = '{QString}'
- ba = '{QByteArray}'
+ st = '{@QString}'
+ ba = '{@QByteArray}'
(ref, dummy,
scheme, userName, password, host, path, # QString
query, # QByteArray
@@ -1782,7 +1782,7 @@ def qdump__QUrl(d, value):
= d.split('i@' + st * 5 + ba + st + ba * 5 + 'i', privAddress)
else:
(ref, port, scheme, userName, password, host, path, query, fragment) \
- = d.split('ii' + '{QString}' * 7, privAddress)
+ = d.split('ii' + '{@QString}' * 7, privAddress)
userNameEnc = d.encodeString(userName)
hostEnc = d.encodeString(host)
@@ -2189,7 +2189,7 @@ def qdump__QXmlAttributes__Attribute(d, value):
d.putExpandable()
if d.isExpanded():
with Children(d):
- (qname, uri, localname, val) = value.split('{QString}' * 4)
+ (qname, uri, localname, val) = value.split('{@QString}' * 4)
d.putSubItem('qname', qname)
d.putSubItem('uri', uri)
d.putSubItem('localname', localname)
@@ -2197,8 +2197,8 @@ def qdump__QXmlAttributes__Attribute(d, value):
def qdump__QXmlAttributes(d, value):
- vptr, atts = value.split('p{QList<QXmlAttributes::Attribute>}')
- _, att_size, _ = d.describeStruct('{QString}' * 4)
+ vptr, atts = value.split('p{@QList<@QXmlAttributes::Attribute>}')
+ _, att_size, _ = d.describeStruct('{@QString}' * 4)
innerType = d.createType(d.qtNamespace() + 'QXmlAttributes::Attribute',
att_size)
qdumpHelper_QList(d, atts, innerType)
@@ -2262,7 +2262,7 @@ def qdump__QV4__Heap__String(d, value):
# Note: There's also the 'Identifier' case. And the largestSubLength != 0 case.
(baseClass, textOrLeft, idOrRight, subtype, stringHash, largestSub, length, mm) \
= value.split('QppIIIIp')
- textPtr = d.split('{QStringDataPtr}', textOrLeft)[0]
+ textPtr = d.split('{@QStringDataPtr}', textOrLeft)[0]
qdump__QStringData(d, d.createValue(textOrLeft, d.qtNamespace() + 'QStringData'))
if d.isExpanded():
with Children(d):
@@ -3063,7 +3063,7 @@ def qdump__QJsonValue(d, value):
return
if t == 3:
d.putType('QJsonValue (String)')
- string = value.split('{QString}')[0]
+ string = value.split('{@QString}')[0]
elided, base = d.encodeString(string, d.displayStringLimit)
d.putValue(base, 'utf16', elided=elided)
return
@@ -3118,14 +3118,14 @@ def qdump__QSqlResultPrivate(d, value):
error1, error2, error3, \
forwardOnly, pad, precisionPolicy, bindCount, \
binds, executedQuery, types, values, indexes, holders = \
- value.split('ppppi@{QString}bb@pppb@iiii{QString}ppp')
+ value.split('ppppi@{@QString}bb@pppb@iiii{@QString}ppp')
d.putStringValue(sql)
d.putPlainChildren(value)
def qdump__QSqlField(d, value):
- val, dptr = value.split('{QVariant}p')
+ val, dptr = value.split('{@QVariant}p')
qdump__QVariant(d, val)
d.putBetterType(d.currentType.value.replace('QVariant', 'QSqlField'))
d.putPlainChildren(value)
@@ -3163,7 +3163,7 @@ def qdump__qfloat16(d, value):
def qdumpHelper_QCbor_string(d, container_ptr, element_index, is_bytes):
- # d.split('i@{QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
+ # d.split('i@{@QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
# so be explicit:
pos = container_ptr + (2 * d.ptrSize() if d.qtVersion() >= 0x060000 else 8)
elements_data_ptr, elements_size, _ = d.vectorData(pos + d.ptrSize())
@@ -3199,7 +3199,7 @@ def qdumpHelper_QCbor_array(d, container_ptr, is_cbor):
if not container_ptr:
d.putItemCount(0)
return
- # d.split('i@{QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
+ # d.split('i@{@QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
# so be explicit:
pos = container_ptr + (2 * d.ptrSize() if d.qtVersion() >= 0x060000 else 8)
elements_data_ptr, elements_size, _ = d.vectorData(pos + d.ptrSize())
@@ -3220,7 +3220,7 @@ def qdumpHelper_QCbor_map(d, container_ptr, is_cbor):
if not container_ptr:
d.putItemCount(0)
return
- # d.split('i@{QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
+ # d.split('i@{@QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
# so be explicit:
pos = container_ptr + (2 * d.ptrSize() if d.qtVersion() >= 0x060000 else 8)
elements_data_ptr, elements_size, _ = d.vectorData(pos + d.ptrSize())
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 8a4fc4b6cd..e16cd7f161 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -2864,21 +2864,21 @@ void tst_Dumpers::dumper_data()
+ CoreProfile()
- + Check("m0", "<0 items>", "@QMap<unsigned int, @QList<QString>>")
+ + Check("m0", "<0 items>", "@QMap<unsigned int, @QList<@QString>>")
- + Check("m1", "<2 items>", "@QMap<unsigned int, @QList<QString>>")
+ + Check("m1", "<2 items>", "@QMap<unsigned int, @QList<@QString>>")
+ CheckPairish("m1.0.key", "11", "unsigned int")
- + CheckPairish("m1.0.value", "<1 items>", "@QList<QString>")
+ + CheckPairish("m1.0.value", "<1 items>", "@QList<@QString>")
+ CheckPairish("m1.0.value.0", "[0]", "\"11\"", "@QString")
+ CheckPairish("m1.1.key", "22", "unsigned int")
- + CheckPairish("m1.1.value", "<1 items>", "@QList<QString>")
+ + CheckPairish("m1.1.value", "<1 items>", "@QList<@QString>")
+ CheckPairish("m1.1.value.0", "[0]", "\"22\"", "@QString")
+ Check("m2", "<2 items>", "@QMap<unsigned int, float>")
+ Check("m2.0", "[0] 11", FloatValue("31.0"), "")
+ Check("m2.1", "[1] 22", FloatValue("32.0"), "")
- + Check("m3", "<2 items>", TypeDef("@QMap<unsigned int,@QList<QString>>", "T"))
+ + Check("m3", "<2 items>", TypeDef("@QMap<unsigned int,@QList<@QString>>", "T"))
+ Check("m4", "<1 items>", "@QMap<@QString, float>")
+ CheckPairish("m4.0.key", "\"22.0\"", "@QString")