Commit e9a2e456 authored by hjk's avatar hjk

Debugger: Fix QXmlAttributes dumper for LLDB

Change-Id: I456424161cc80acc4057a56f62af5d33acf2eef7
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 41e47513
......@@ -734,15 +734,16 @@ def qform__QList():
return "Assume Direct Storage,Assume Indirect Storage"
def qdump__QList(d, value):
dptr = d.childAt(value, 0)["d"]
private = dptr.dereference()
begin = int(private["begin"])
end = int(private["end"])
array = private["array"]
base = d.extractPointer(value)
begin = d.extractInt(base + 8)
end = d.extractInt(base + 12)
array = base + 16
if d.qtVersion() < 0x50000:
array += d.ptrSize()
d.check(begin >= 0 and end >= 0 and end <= 1000 * 1000 * 1000)
size = end - begin
d.check(size >= 0)
d.checkRef(private["ref"])
#d.checkRef(private["ref"])
innerType = d.templateArgument(value.type, 0)
......@@ -750,8 +751,8 @@ def qdump__QList(d, value):
d.putNumChild(size)
if d.isExpanded():
innerSize = innerType.sizeof
stepSize = dptr.type.sizeof
addr = d.addressOf(array) + begin * stepSize
stepSize = d.ptrSize()
addr = array + begin * stepSize
# The exact condition here is:
# QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic
# but this data is available neither in the compiled binary nor
......@@ -774,12 +775,12 @@ def qdump__QList(d, value):
p = d.createValue(addr + i * stepSize, innerType)
d.putSubItem(i, p)
else:
p = d.createPointerValue(addr, innerType.pointer())
# about 0.5s / 1000 items
with Children(d, size, maxNumChild=2000, childType=innerType):
for i in d.childRange():
d.putSubItem(i, p.dereference().dereference())
p += 1
p = d.extractPointer(addr + i * stepSize)
x = d.createValue(p, innerType)
d.putSubItem(i, x)
def qform__QImage():
return "Normal,Displayed"
......@@ -2224,8 +2225,8 @@ def qdump__QWeakPointer(d, value):
d.putIntItem("strongref", strongref)
def qdump__QxXmlAttributes(d, value):
pass
def qdump__QXmlAttributes(d, value):
qdump__QList(d, value["attList"])
#######################################################################
......
......@@ -3370,23 +3370,22 @@ void tst_Dumpers::dumper_data()
+ CoreProfile()
+ Profile("QT += xml\n")
+ Check("atts", "", "@QXmlAttributes")
+ Check("atts.attList", "<3 items>", "@QXmlAttributes::AttributeList")
+ Check("atts.attList.0", "[0]", "", "@QXmlAttributes::Attribute")
+ Check("atts.attList.0.localname", "\"localPart1\"", "@QString")
+ Check("atts.attList.0.qname", "\"name1\"", "@QString")
+ Check("atts.attList.0.uri", "\"uri1\"", "@QString")
+ Check("atts.attList.0.value", "\"value1\"", "@QString")
+ Check("atts.attList.1", "[1]", "", "@QXmlAttributes::Attribute")
+ Check("atts.attList.1.localname", "\"localPart2\"", "@QString")
+ Check("atts.attList.1.qname", "\"name2\"", "@QString")
+ Check("atts.attList.1.uri", "\"uri2\"", "@QString")
+ Check("atts.attList.1.value", "\"value2\"", "@QString")
+ Check("atts.attList.2", "[2]", "", "@QXmlAttributes::Attribute")
+ Check("atts.attList.2.localname", "\"localPart3\"", "@QString")
+ Check("atts.attList.2.qname", "\"name3\"", "@QString")
+ Check("atts.attList.2.uri", "\"uri3\"", "@QString")
+ Check("atts.attList.2.value", "\"value3\"", "@QString");
+ Check("atts", "<3 items>", "@QXmlAttributes")
+ Check("atts.0", "[0]", "", "@QXmlAttributes::Attribute")
+ Check("atts.0.localname", "\"localPart1\"", "@QString")
+ Check("atts.0.qname", "\"name1\"", "@QString")
+ Check("atts.0.uri", "\"uri1\"", "@QString")
+ Check("atts.0.value", "\"value1\"", "@QString")
+ Check("atts.1", "[1]", "", "@QXmlAttributes::Attribute")
+ Check("atts.1.localname", "\"localPart2\"", "@QString")
+ Check("atts.1.qname", "\"name2\"", "@QString")
+ Check("atts.1.uri", "\"uri2\"", "@QString")
+ Check("atts.1.value", "\"value2\"", "@QString")
+ Check("atts.2", "[2]", "", "@QXmlAttributes::Attribute")
+ Check("atts.2.localname", "\"localPart3\"", "@QString")
+ Check("atts.2.qname", "\"name3\"", "@QString")
+ Check("atts.2.uri", "\"uri3\"", "@QString")
+ Check("atts.2.value", "\"value3\"", "@QString");
QTest::newRow("StdArray")
......
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