Commit 842540d9 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Dump QObjects for CDB

parent 9ebba84b
...@@ -893,7 +893,7 @@ enum InnerValueResult ...@@ -893,7 +893,7 @@ enum InnerValueResult
InnerValueNotHandled, InnerValueNotHandled,
InnerValueChildrenSpecified, InnerValueChildrenSpecified,
InnerValueNoFurtherChildren, InnerValueNoFurtherChildren,
InnerValueFurtherChildren InnerValueFurtherChildren
}; };
static inline void dumpChildNumChildren(QDumper &d, InnerValueResult innerValueResult) static inline void dumpChildNumChildren(QDumper &d, InnerValueResult innerValueResult)
...@@ -1989,33 +1989,42 @@ static void qDumpQObject(QDumper &d) ...@@ -1989,33 +1989,42 @@ static void qDumpQObject(QDumper &d)
d.beginChildren(); d.beginChildren();
d.beginHash(); d.beginHash();
d.putItem("name", "properties"); d.putItem("name", "properties");
// using 'addr' does not work as 'exp' is recreated as // using 'addr' does not work in gdb as 'exp' is recreated as
// (type *)addr, and here we have different 'types': // (type *)addr, and here we have different 'types':
// QObject vs QObjectPropertyList! // QObject vs QObjectPropertyList!
//d.putItem("addr", d.data); #ifdef Q_CC_MSVC
d.putItem("addr", d.data);
#else
d.beginItem("exp"); d.beginItem("exp");
d.put("*(class "NSX"QObject"NSY"*)").put(d.data); d.put("*(class "NSX"QObject"NSY"*)").put(d.data);
d.endItem(); d.endItem();
#endif
d.putItem("type", NS"QObjectPropertyList"); d.putItem("type", NS"QObjectPropertyList");
d.putItemCount("value", mo->propertyCount()); d.putItemCount("value", mo->propertyCount());
d.putItem("numchild", mo->propertyCount()); d.putItem("numchild", mo->propertyCount());
d.endHash(); d.endHash();
d.beginHash(); d.beginHash();
d.putItem("name", "signals"); d.putItem("name", "signals");
//d.putItem("addr", d.data); #ifdef Q_CC_MSVC
d.putItem("addr", d.data);
#else
d.beginItem("exp"); d.beginItem("exp");
d.put("*(class "NSX"QObject"NSY"*)").put(d.data); d.put("*(class "NSX"QObject"NSY"*)").put(d.data);
d.endItem(); d.endItem();
#endif
d.putItem("type", NS"QObjectSignalList"); d.putItem("type", NS"QObjectSignalList");
d.putItemCount("value", signalCount); d.putItemCount("value", signalCount);
d.putItem("numchild", signalCount); d.putItem("numchild", signalCount);
d.endHash(); d.endHash();
d.beginHash(); d.beginHash();
d.putItem("name", "slots"); d.putItem("name", "slots");
//d.putItem("addr", d.data); #ifdef Q_CC_MSVC
d.putItem("addr", d.data);
#else
d.beginItem("exp"); d.beginItem("exp");
d.put("*(class "NSX"QObject"NSY"*)").put(d.data); d.put("*(class "NSX"QObject"NSY"*)").put(d.data);
d.endItem(); d.endItem();
#endif
d.putItem("type", NS"QObjectSlotList"); d.putItem("type", NS"QObjectSlotList");
d.putItemCount("value", slotCount); d.putItemCount("value", slotCount);
d.putItem("numchild", slotCount); d.putItem("numchild", slotCount);
...@@ -2024,10 +2033,13 @@ static void qDumpQObject(QDumper &d) ...@@ -2024,10 +2033,13 @@ static void qDumpQObject(QDumper &d)
if (!objectChildren.empty()) { if (!objectChildren.empty()) {
d.beginHash(); d.beginHash();
d.putItem("name", "children"); d.putItem("name", "children");
//d.putItem("addr", d.data); #ifdef Q_CC_MSVC
d.putItem("addr", d.data);
#else
d.beginItem("exp"); d.beginItem("exp");
d.put("*(class "NSX"QObject"NSY"*)").put(d.data); d.put("*(class "NSX"QObject"NSY"*)").put(d.data);
d.endItem(); d.endItem();
#endif
d.putItem("type", NS"QObjectChildList"); d.putItem("type", NS"QObjectChildList");
d.putItemCount("value", objectChildren.size()); d.putItemCount("value", objectChildren.size());
d.putItem("numchild", objectChildren.size()); d.putItem("numchild", objectChildren.size());
......
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