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