Commit e195159f authored by hjk's avatar hjk

debugger: fix dumpers for QSharedPointer and QWeakPointer for the isNull() case

parent fab99c33
......@@ -2722,6 +2722,14 @@ static void qDumpQSharedPointer(QDumper &d)
const QSharedPointer<int> &ptr =
*reinterpret_cast<const QSharedPointer<int> *>(d.data);
if (ptr.isNull()) {
d.putItem("value", "<null>");
d.putItem("valuedisabled", "true");
d.putItem("numchild", 0);
d.disarm();
return;
}
if (isSimpleType(d.innertype))
qDumpInnerValueHelper(d, d.innertype, ptr.data());
else
......@@ -2878,6 +2886,15 @@ static void qDumpQWeakPointer(QDumper &d)
{
const int v = sizeof(void *);
const void *value = deref(addOffset(d.data, v));
const void *data = deref(d.data);
if (value == 0 || data == 0) {
d.putItem("value", "<null>");
d.putItem("valuedisabled", "true");
d.putItem("numchild", 0);
d.disarm();
return;
}
if (isSimpleType(d.innertype))
qDumpInnerValueHelper(d, d.innertype, value);
......
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