forked from qt-creator/qt-creator
Debugger: Adapt QHostAddress dumper after Qt Core change a6cdfacf
Change-Id: I750d37f7ab23a638c2e0c5f0fd808ba22a0b49d0 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -737,8 +737,13 @@ def qdump__QHostAddress(d, value):
|
|||||||
qtVersion = d.qtVersion()
|
qtVersion = d.qtVersion()
|
||||||
tiVersion = d.qtTypeInfoVersion()
|
tiVersion = d.qtTypeInfoVersion()
|
||||||
#warn('QT: %x, TI: %s' % (qtVersion, tiVersion))
|
#warn('QT: %x, TI: %s' % (qtVersion, tiVersion))
|
||||||
|
mayNeedParse = True
|
||||||
if tiVersion is not None:
|
if tiVersion is not None:
|
||||||
if tiVersion >= 5:
|
if tiVersion >= 16:
|
||||||
|
# After a6cdfacf
|
||||||
|
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.8.0 at f70b4a13 TI: 15
|
||||||
# Branch 5.7.0 at b6cf0418 TI: 5
|
# Branch 5.7.0 at b6cf0418 TI: 5
|
||||||
(ipString, scopeId, a6, a4, protocol, isParsed) \
|
(ipString, scopeId, a6, a4, protocol, isParsed) \
|
||||||
@@ -760,8 +765,9 @@ def qdump__QHostAddress(d, value):
|
|||||||
(a4, a6, protocol, pad, ipString, isParsed, pad, scopeId) \
|
(a4, a6, protocol, pad, ipString, isParsed, pad, scopeId) \
|
||||||
= d.split('{quint32}16sB@{QString}{bool}@{QString}', dd)
|
= d.split('{quint32}16sB@{QString}{bool}@{QString}', dd)
|
||||||
|
|
||||||
(ipStringData, ipStringSize, ipStringAlloc) = d.stringData(ipString)
|
if mayNeedParse:
|
||||||
if isParsed.integer() and ipStringSize > 0:
|
ipStringData, ipStringSize, ipStringAlloc = d.stringData(ipString)
|
||||||
|
if mayNeedParse and isParsed.integer() and ipStringSize > 0:
|
||||||
d.putStringValue(ipString)
|
d.putStringValue(ipString)
|
||||||
else:
|
else:
|
||||||
# value.d.d->protocol:
|
# value.d.d->protocol:
|
||||||
@@ -786,9 +792,10 @@ def qdump__QHostAddress(d, value):
|
|||||||
d.putNumChild(4)
|
d.putNumChild(4)
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
with Children(d):
|
with Children(d):
|
||||||
|
if mayNeedParse:
|
||||||
d.putSubItem('ipString', ipString)
|
d.putSubItem('ipString', ipString)
|
||||||
d.putSubItem('scopeId', scopeId)
|
|
||||||
d.putSubItem('isParsed', isParsed)
|
d.putSubItem('isParsed', isParsed)
|
||||||
|
d.putSubItem('scopeId', scopeId)
|
||||||
d.putSubItem('a', a4)
|
d.putSubItem('a', a4)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2047,7 +2047,7 @@ void tst_Dumpers::dumper_data()
|
|||||||
+ NetworkProfile()
|
+ NetworkProfile()
|
||||||
|
|
||||||
+ Check("ha1", "129.0.0.130", "@QHostAddress")
|
+ Check("ha1", "129.0.0.130", "@QHostAddress")
|
||||||
+ Check("ha2", "\"127.0.0.1\"", "@QHostAddress")
|
+ Check("ha2", ValuePattern(".*127.0.0.1.*"), "@QHostAddress")
|
||||||
+ Check("addr", "1:203:506:0:809:a0b:0:0", "@QIPv6Address")
|
+ Check("addr", "1:203:506:0:809:a0b:0:0", "@QIPv6Address")
|
||||||
+ Check("addr.3", "[3]", "3", "unsigned char");
|
+ Check("addr.3", "[3]", "3", "unsigned char");
|
||||||
|
|
||||||
@@ -3695,26 +3695,26 @@ void tst_Dumpers::dumper_data()
|
|||||||
|
|
||||||
+ NetworkProfile()
|
+ NetworkProfile()
|
||||||
|
|
||||||
+ Check("ha", "\"127.0.0.1\"", "@QHostAddress")
|
+ Check("ha", ValuePattern(".*127.0.0.1.*"), "@QHostAddress")
|
||||||
+ Check("ha.a", "2130706433", TypeDef("unsigned int", "@quint32"))
|
+ Check("ha.a", "2130706433", TypeDef("unsigned int", "@quint32"))
|
||||||
+ Check("ha.ipString", "\"127.0.0.1\"", "@QString")
|
+ Check("ha.ipString", ValuePattern(".*127.0.0.1.*"), "@QString")
|
||||||
+ Check("ha.isParsed", "1", "bool")
|
% QtVersion(0, 0x50800)
|
||||||
//+ Check("ha.protocol", "@QAbstractSocket::IPv4Protocol (0)",
|
//+ Check("ha.protocol", "@QAbstractSocket::IPv4Protocol (0)",
|
||||||
// "@QAbstractSocket::NetworkLayerProtocol") % GdbEngine
|
// "@QAbstractSocket::NetworkLayerProtocol") % GdbEngine
|
||||||
//+ Check("ha.protocol", "IPv4Protocol",
|
//+ Check("ha.protocol", "IPv4Protocol",
|
||||||
// "@QAbstractSocket::NetworkLayerProtocol") % LldbEngine
|
// "@QAbstractSocket::NetworkLayerProtocol") % LldbEngine
|
||||||
+ Check("ha.scopeId", "\"\"", "@QString")
|
+ Check("ha.scopeId", "\"\"", "@QString")
|
||||||
+ Check("ha1", "\"127.0.0.1\"", "@QHostAddress")
|
+ Check("ha1", ValuePattern(".*127.0.0.1.*"), "@QHostAddress")
|
||||||
+ Check("ha1.a", "2130706433", TypeDef("unsigned int", "@quint32"))
|
+ Check("ha1.a", "2130706433", TypeDef("unsigned int", "@quint32"))
|
||||||
+ Check("ha1.ipString", "\"127.0.0.1\"", "@QString")
|
+ Check("ha1.ipString", "\"127.0.0.1\"", "@QString")
|
||||||
+ Check("ha1.isParsed", "1", "bool")
|
% QtVersion(0, 0x50800)
|
||||||
//+ Check("ha1.protocol", "@QAbstractSocket::IPv4Protocol (0)",
|
//+ Check("ha1.protocol", "@QAbstractSocket::IPv4Protocol (0)",
|
||||||
// "@QAbstractSocket::NetworkLayerProtocol") % GdbEngine
|
// "@QAbstractSocket::NetworkLayerProtocol") % GdbEngine
|
||||||
//+ Check("ha1.protocol", "IPv4Protocol",
|
//+ Check("ha1.protocol", "IPv4Protocol",
|
||||||
// "@QAbstractSocket::NetworkLayerProtocol") % LldbEngine
|
// "@QAbstractSocket::NetworkLayerProtocol") % LldbEngine
|
||||||
+ Check("ha1.scopeId", "\"\"", "@QString")
|
+ Check("ha1.scopeId", "\"\"", "@QString")
|
||||||
+ Check("var", "", "@QVariant (@QHostAddress)")
|
+ Check("var", "", "@QVariant (@QHostAddress)")
|
||||||
+ Check("var.data", "\"127.0.0.1\"", "@QHostAddress");
|
+ Check("var.data", ValuePattern(".*127.0.0.1.*"), "@QHostAddress");
|
||||||
|
|
||||||
|
|
||||||
QTest::newRow("QVariantList")
|
QTest::newRow("QVariantList")
|
||||||
|
Reference in New Issue
Block a user