forked from qt-creator/qt-creator
Debugger: add dumper for Utils::Environment
Change-Id: I2e80447b9b9690376a6d789c8b18d33cca22f4ab Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
from dumper import Children
|
||||
|
||||
|
||||
def typeTarget(type):
|
||||
target = type.target()
|
||||
@@ -242,6 +244,39 @@ def qdump__Utils__Port(d, value):
|
||||
d.putPlainChildren(value)
|
||||
|
||||
|
||||
|
||||
def qdump__Utils__Environment(d, value):
|
||||
qdump__Utils__NameValueDictionary(d, value)
|
||||
|
||||
|
||||
def qdump__Utils__NameValueDictionary(d, value):
|
||||
dptr = d.extractPointer(value["m_values"])
|
||||
(ref, n) = d.split('ii', dptr)
|
||||
d.check(0 <= n and n <= 100 * 1000 * 1000)
|
||||
d.check(-1 <= ref and ref < 100000)
|
||||
|
||||
d.putItemCount(n)
|
||||
if d.isExpanded():
|
||||
if n > 10000:
|
||||
n = 10000
|
||||
|
||||
typeCode = 'ppp@{%s}@{%s}' % ("Utils::DictKey", "QString")
|
||||
|
||||
def helper(node):
|
||||
(p, left, right, padding1, key, padding2, value) = d.split(typeCode, node)
|
||||
if left:
|
||||
for res in helper(left):
|
||||
yield res
|
||||
yield (key["name"], value)
|
||||
if right:
|
||||
for res in helper(right):
|
||||
yield res
|
||||
|
||||
with Children(d, n):
|
||||
for (pair, i) in zip(helper(dptr + 8), range(n)):
|
||||
d.putPairItem(i, pair, 'key', 'value')
|
||||
|
||||
|
||||
def qdump__Utf8String(d, value):
|
||||
d.putByteArrayValue(value['byteArray'])
|
||||
d.putPlainChildren(value)
|
||||
|
Reference in New Issue
Block a user