forked from qt-creator/qt-creator
Debugger: Make QByteArray, QString and QList dumper work with Qt dev
Note that this is more a temporary workaround as there are more changes to come (qsizetype instead of int for sizes, switch QList/QVector aliasing). Task-number: QTCREATORBUG-23806 Change-Id: Ic815fe293b1c4922276c127dec61930dc365acae Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -55,11 +55,22 @@ def qedit__QByteArray(d, value, data):
|
|||||||
|
|
||||||
|
|
||||||
def qdump__QByteArray(d, value):
|
def qdump__QByteArray(d, value):
|
||||||
|
if d.qtVersion() >= 0x60000:
|
||||||
|
dd, data, size = value.split('ppi')
|
||||||
|
_, _, alloc = d.split('iii', dd)
|
||||||
|
else:
|
||||||
data, size, alloc = d.byteArrayData(value)
|
data, size, alloc = d.byteArrayData(value)
|
||||||
|
|
||||||
d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000))
|
d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000))
|
||||||
if size > 0:
|
if size > 0:
|
||||||
d.putExpandable()
|
d.putExpandable()
|
||||||
|
|
||||||
|
if d.qtVersion() >= 0x60000:
|
||||||
|
elided, shown = d.computeLimit(size, d.displayStringLimit)
|
||||||
|
p = d.readMemory(data, shown)
|
||||||
|
else:
|
||||||
elided, p = d.encodeByteArrayHelper(d.extractPointer(value), d.displayStringLimit)
|
elided, p = d.encodeByteArrayHelper(d.extractPointer(value), d.displayStringLimit)
|
||||||
|
|
||||||
displayFormat = d.currentItemFormat()
|
displayFormat = d.currentItemFormat()
|
||||||
if displayFormat == DisplayFormat.Automatic or displayFormat == DisplayFormat.Latin1String:
|
if displayFormat == DisplayFormat.Automatic or displayFormat == DisplayFormat.Latin1String:
|
||||||
d.putValue(p, 'latin1', elided=elided)
|
d.putValue(p, 'latin1', elided=elided)
|
||||||
@@ -965,6 +976,7 @@ def qform__QList():
|
|||||||
|
|
||||||
|
|
||||||
def qdump__QList(d, value):
|
def qdump__QList(d, value):
|
||||||
|
inner_type = value.type.ltarget[0] if value.type.code == TypeCode.Typedef else value.type[0]
|
||||||
return qdumpHelper_QList(d, value, value.type[0])
|
return qdumpHelper_QList(d, value, value.type[0])
|
||||||
|
|
||||||
|
|
||||||
@@ -973,6 +985,12 @@ def qdump__QVariantList(d, value):
|
|||||||
|
|
||||||
|
|
||||||
def qdumpHelper_QList(d, value, innerType):
|
def qdumpHelper_QList(d, value, innerType):
|
||||||
|
if d.qtVersion() >= 0x60000:
|
||||||
|
dd, data, size = value.split('ppi')
|
||||||
|
_, _, alloc = d.split('iii', dd)
|
||||||
|
d.putItemCount(size)
|
||||||
|
d.putPlotData(data, size, innerType)
|
||||||
|
return
|
||||||
base = d.extractPointer(value)
|
base = d.extractPointer(value)
|
||||||
(ref, alloc, begin, end) = d.split('IIII', base)
|
(ref, alloc, begin, end) = d.split('IIII', base)
|
||||||
array = base + 16
|
array = base + 16
|
||||||
@@ -1536,6 +1554,13 @@ def qform__QString():
|
|||||||
|
|
||||||
|
|
||||||
def qdump__QString(d, value):
|
def qdump__QString(d, value):
|
||||||
|
if d.qtVersion() >= 0x60000:
|
||||||
|
dd, data, size = value.split('ppi')
|
||||||
|
_, _, alloc = d.split('iii', dd)
|
||||||
|
elided, shown = d.computeLimit(2 * size, d.displayStringLimit)
|
||||||
|
p = d.readMemory(data, shown)
|
||||||
|
d.putValue(p, 'utf16', elided=elided)
|
||||||
|
else:
|
||||||
d.putStringValue(value)
|
d.putStringValue(value)
|
||||||
(data, size, alloc) = d.stringData(value)
|
(data, size, alloc) = d.stringData(value)
|
||||||
displayFormat = d.currentItemFormat()
|
displayFormat = d.currentItemFormat()
|
||||||
@@ -1999,6 +2024,10 @@ def qform__QVector():
|
|||||||
|
|
||||||
|
|
||||||
def qdump__QVector(d, value):
|
def qdump__QVector(d, value):
|
||||||
|
if d.qtVersion() >= 0x060000:
|
||||||
|
dd, data, size = value.split('ppi')
|
||||||
|
_, _, alloc = d.split('iii', dd)
|
||||||
|
else:
|
||||||
dd = d.extractPointer(value)
|
dd = d.extractPointer(value)
|
||||||
data, size, alloc = d.vectorDataHelper(dd)
|
data, size, alloc = d.vectorDataHelper(dd)
|
||||||
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
|
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
|
||||||
|
Reference in New Issue
Block a user