Commit 239dee6e authored by hjk's avatar hjk

Debugger: Add a backend specific Dumper.hasChildWithName

Change-Id: I89432915f2b6eb52e706d344b9e7998e1f96ab1f
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 580a8c16
......@@ -717,6 +717,13 @@ class Dumper(DumperBase):
def call(self, value, func, *args):
return self.call2(value, func, args)
def hasChildWithName(self, value, name):
try:
value[name]
return True
except:
return False
def makeValue(self, type, init):
type = "::" + stripClassTag(str(type));
# Avoid malloc symbol clash with QVector.
......
......@@ -377,6 +377,9 @@ class Dumper(DumperBase):
typeClass = typeobj.GetTypeClass()
return typeClass == lldb.eTypeClassBuiltin
def hasChildWithName(self, value, name):
return value.GetChildMemberWithName(name).IsValid()
def childAt(self, value, index):
return value.GetChildAtIndex(index)
......
......@@ -288,10 +288,10 @@ def stdTreeIteratorHelper(d, value):
nodeType = d.lookupType(nodeTypeName)
data = node.cast(nodeType)["_M_value_field"]
with Children(d):
try:
if d.hasChildWithName(data, "first"):
d.putSubItem("first", data["first"])
d.putSubItem("second", data["second"])
except:
else:
d.putSubItem("value", data)
with SubItem(d, "node"):
d.putNumChild(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment