forked from qt-creator/qt-creator
Debugger: Improve QSharedPointer dumper
Make it work with LLDB, show simple values always directly. Change-Id: I463ef81183792f85243d679dee69a41db00bed07 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -1362,6 +1362,9 @@ class Dumper(DumperBase):
|
||||
self.currentValuePriority = priority
|
||||
self.currentValueEncoding = None
|
||||
|
||||
def putSimpleValue(self, value, encoding = None, priority = 0):
|
||||
self.putValue(value, encoding, priority)
|
||||
|
||||
def putValue(self, value, encoding = None, priority = 0):
|
||||
# Higher priority values override lower ones.
|
||||
if priority >= self.currentValuePriority:
|
||||
|
||||
@@ -607,6 +607,9 @@ class Dumper(DumperBase):
|
||||
self.currentValuePriority = priority
|
||||
self.currentValueEncoding = None
|
||||
|
||||
def putSimpleValue(self, value, encoding = None, priority = 0):
|
||||
self.putValue(value.GetValue(), encoding, priority)
|
||||
|
||||
def putValue(self, value, encoding = None, priority = 0):
|
||||
# Higher priority values override lower ones.
|
||||
if priority >= self.currentValuePriority:
|
||||
|
||||
@@ -1970,16 +1970,15 @@ def qdump__QWeakPointer(d, value):
|
||||
d.check(strongref <= weakref)
|
||||
d.check(weakref <= 10*1000*1000)
|
||||
|
||||
if d.isSimpleType(val.dereference().type):
|
||||
d.putNumChild(3)
|
||||
d.putItem(val.dereference())
|
||||
innerType = d.templateArgument(value.type, 0)
|
||||
if d.isSimpleType(innerType):
|
||||
d.putSimpleValue(val.dereference())
|
||||
else:
|
||||
d.putEmptyValue()
|
||||
|
||||
d.putNumChild(3)
|
||||
if d.isExpanded():
|
||||
with Children(d):
|
||||
innerType = d.templateArgument(value.type, 0)
|
||||
d.putSubItem("data", val.dereference().cast(innerType))
|
||||
d.putIntItem("weakref", weakref)
|
||||
d.putIntItem("strongref", strongref)
|
||||
|
||||
@@ -2395,11 +2395,11 @@ void tst_Dumpers::dumper_data()
|
||||
"QWeakPointer<int> ptr3 = ptr;\n"
|
||||
"unused(&ptr, &ptr2, &ptr3);\n")
|
||||
% CoreProfile()
|
||||
% Check("iptr", "", "@QSharedPointer<int>")
|
||||
% Check("iptr", "43", "@QSharedPointer<int>")
|
||||
% Check("iptr.data", "43", "int")
|
||||
% Check("iptr.weakref", "4", "int")
|
||||
% Check("iptr.strongref", "1", "int")
|
||||
% Check("ptr3", "43", "int")
|
||||
% Check("ptr3", "43", "@QWeakPointer<int>")
|
||||
% Check("ptr3.data", "43", "int");
|
||||
|
||||
QTest::newRow("QSharedPointer4")
|
||||
|
||||
Reference in New Issue
Block a user