forked from qt-creator/qt-creator
Debugger: Use direct memory access for std tree types
Change-Id: I98acf000c612831401c01a0a30ed50c18d92c8c5 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -249,17 +249,8 @@ def qform__std__map():
|
|||||||
return mapForms()
|
return mapForms()
|
||||||
|
|
||||||
def qdump__std__map(d, value):
|
def qdump__std__map(d, value):
|
||||||
if d.isQnxTarget():
|
if d.isQnxTarget() or d.isMsvcTarget():
|
||||||
proxy, head, size = value.split('ppI')
|
qdump_std__map__helper(d, value)
|
||||||
d.putItemCount(size)
|
|
||||||
qdump_std__map__helper(d, size, value)
|
|
||||||
return
|
|
||||||
elif d.isMsvcTarget():
|
|
||||||
proxy, head, size = value.split('ppQ')
|
|
||||||
d.putItemCount(size)
|
|
||||||
try:
|
|
||||||
qdump_std__map__helper(d, size, value['_Mypair']['_Myval2']['_Myval2'])
|
|
||||||
finally:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# stuff is actually (color, pad) with 'I@', but we can save cycles/
|
# stuff is actually (color, pad) with 'I@', but we can save cycles/
|
||||||
@@ -293,26 +284,28 @@ def qdump__std__map(d, value):
|
|||||||
break
|
break
|
||||||
node = node["_M_left"]
|
node = node["_M_left"]
|
||||||
|
|
||||||
def qdump_std__map__helper(d, size, value):
|
def qdump_std__map__helper(d, value):
|
||||||
|
(proxy, head, size) = value.split("ppp")
|
||||||
|
d.check(0 <= size and size <= 100*1000*1000)
|
||||||
|
d.putItemCount(size)
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
head = value['_Myhead']
|
keyType = value.type[0]
|
||||||
node = head['_Left']
|
valueType = value.type[1]
|
||||||
nodeType = head.type
|
pairType = value.type[3][0]
|
||||||
|
def helper(node):
|
||||||
|
(left, parent, right, color, isnil, pad, pair) = d.split("pppcc@{%s}" % (pairType.name), node)
|
||||||
|
if left != head:
|
||||||
|
for res in helper(left):
|
||||||
|
yield res
|
||||||
|
yield pair.split("{%s}@{%s}" % (keyType.name, valueType.name))[::2]
|
||||||
|
if right != head:
|
||||||
|
for res in helper(right):
|
||||||
|
yield res
|
||||||
|
|
||||||
|
(smallest, root) = d.split("pp", head)
|
||||||
with Children(d, size, maxNumChild=1000):
|
with Children(d, size, maxNumChild=1000):
|
||||||
for i in d.childRange():
|
for (pair, i) in zip(helper(root), d.childRange()):
|
||||||
pair = node.cast(nodeType).dereference()['_Myval']
|
|
||||||
d.putPairItem(i, pair)
|
d.putPairItem(i, pair)
|
||||||
if node['_Right']['_Isnil'].pointer() == 0:
|
|
||||||
node = node['_Right']
|
|
||||||
while node['_Left']['_Isnil'].pointer() == 0:
|
|
||||||
node = node['_Left']
|
|
||||||
else:
|
|
||||||
parent = node['_Parent']
|
|
||||||
while node and parent['_Right']['_Isnil'].pointer() == 0:
|
|
||||||
node = parent
|
|
||||||
parent = parent['_Parent']
|
|
||||||
if node['_Right'] != parent:
|
|
||||||
node = parent
|
|
||||||
|
|
||||||
def qdump__std____debug__map(d, value):
|
def qdump__std____debug__map(d, value):
|
||||||
qdump__std__map(d, value)
|
qdump__std__map(d, value)
|
||||||
@@ -391,7 +384,7 @@ def qdump__std____cxx1998__set(d, value):
|
|||||||
qdump__std__set(d, value)
|
qdump__std__set(d, value)
|
||||||
|
|
||||||
def qdump__std__set(d, value):
|
def qdump__std__set(d, value):
|
||||||
if d.isQnxTarget():
|
if d.isQnxTarget() or d.isMsvcTarget():
|
||||||
qdump__std__set__QNX(d, value)
|
qdump__std__set__QNX(d, value)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -421,27 +414,25 @@ def qdump__std__set(d, value):
|
|||||||
node = node["_M_left"]
|
node = node["_M_left"]
|
||||||
|
|
||||||
def qdump__std__set__QNX(d, value):
|
def qdump__std__set__QNX(d, value):
|
||||||
size = value['_Mysize']
|
(proxy, head, size) = value.split("ppp")
|
||||||
d.check(0 <= size and size <= 100*1000*1000)
|
d.check(0 <= size and size <= 100*1000*1000)
|
||||||
d.putItemCount(size)
|
d.putItemCount(size)
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
head = value['_Myhead']
|
childType=value.type[0]
|
||||||
node = head['_Left']
|
def helper(node):
|
||||||
nodeType = head.type
|
(left, parent, right, color, isnil, pad, value) = d.split("pppcc@{%s}" % childType.name, node)
|
||||||
with Children(d, size, maxNumChild=1000, childType=value.type[0]):
|
if left != head:
|
||||||
for i in d.childRange():
|
for res in helper(left):
|
||||||
d.putSubItem(i, node.cast(nodeType).dereference()['_Myval'])
|
yield res
|
||||||
if not node['_Right']['_Isnil']:
|
yield value
|
||||||
node = node['_Right']
|
if right != head:
|
||||||
while not node['_Left']['_Isnil']:
|
for res in helper(right):
|
||||||
node = node['_Left']
|
yield res
|
||||||
else:
|
|
||||||
parent = node['_Parent']
|
(smallest, root) = d.split("pp", head)
|
||||||
while node == parent['_Right']['_Isnil']:
|
with Children(d, size, maxNumChild=1000):
|
||||||
node = parent
|
for (item, i) in zip(helper(root), d.childRange()):
|
||||||
parent = parent['_Parent']
|
d.putSubItem(i, item)
|
||||||
if node['_Right'] != parent:
|
|
||||||
node = parent
|
|
||||||
|
|
||||||
def std1TreeMin(d, node):
|
def std1TreeMin(d, node):
|
||||||
#_NodePtr __tree_min(_NodePtr __x):
|
#_NodePtr __tree_min(_NodePtr __x):
|
||||||
|
Reference in New Issue
Block a user