forked from qt-creator/qt-creator
CDB: Fix dumping of objectNames() in Qt 5.
Qt 5 has an additional extraData. Change-Id: Ieac0a1855ed93b4ef2c0900e37097d89de440895 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -2122,21 +2122,32 @@ SymbolGroupValue qobjectDerivedPrivate(const SymbolGroupValue &v,
|
|||||||
return SymbolGroupValue(qwPrivateNode, v.context());
|
return SymbolGroupValue(qwPrivateNode, v.context());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool dumpQObjectName(const SymbolGroupValue &qoPrivate, std::wostream &str)
|
||||||
|
{
|
||||||
|
// Qt 4: plain member.
|
||||||
|
if (QtInfo::get(qoPrivate.context()).version < 5) {
|
||||||
|
if (const SymbolGroupValue oName = qoPrivate["objectName"])
|
||||||
|
return dumpQString(oName, str);
|
||||||
|
}
|
||||||
|
// Qt 5: member of allocated extraData.
|
||||||
|
if (const SymbolGroupValue extraData = qoPrivate["extraData"])
|
||||||
|
if (extraData.pointerValue())
|
||||||
|
if (const SymbolGroupValue oName = extraData["objectName"])
|
||||||
|
return dumpQString(oName, str);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Dump the object name
|
// Dump the object name
|
||||||
static inline bool dumpQWidget(const SymbolGroupValue &v, std::wostream &str, void **specialInfoIn = 0)
|
static inline bool dumpQWidget(const SymbolGroupValue &v, std::wostream &str, void **specialInfoIn = 0)
|
||||||
{
|
{
|
||||||
const QtInfo &qtInfo = QtInfo::get(v.context());
|
const QtInfo &qtInfo = QtInfo::get(v.context());
|
||||||
const SymbolGroupValue qwPrivate =
|
const SymbolGroupValue qwPrivate =
|
||||||
qobjectDerivedPrivate(v, qtInfo.qWidgetPrivateType, qtInfo);
|
qobjectDerivedPrivate(v, qtInfo.qWidgetPrivateType, qtInfo);
|
||||||
if (!qwPrivate)
|
|
||||||
return false;
|
|
||||||
// QWidgetPrivate inherits QObjectPrivate
|
// QWidgetPrivate inherits QObjectPrivate
|
||||||
const SymbolGroupValue oName = qwPrivate[unsigned(0)]["objectName"];
|
if (!qwPrivate || !dumpQObjectName(qwPrivate[unsigned(0)], str))
|
||||||
if (!oName)
|
|
||||||
return false;
|
return false;
|
||||||
if (specialInfoIn)
|
if (specialInfoIn)
|
||||||
*specialInfoIn = qwPrivate.node();
|
*specialInfoIn = qwPrivate.node();
|
||||||
dumpQString(oName, str);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2144,15 +2155,12 @@ static inline bool dumpQWidget(const SymbolGroupValue &v, std::wostream &str, vo
|
|||||||
static inline bool dumpQObject(const SymbolGroupValue &v, std::wostream &str, void **specialInfoIn = 0)
|
static inline bool dumpQObject(const SymbolGroupValue &v, std::wostream &str, void **specialInfoIn = 0)
|
||||||
{
|
{
|
||||||
const std::string &qoPrivateType = QtInfo::get(v.context()).qObjectPrivateType;
|
const std::string &qoPrivateType = QtInfo::get(v.context()).qObjectPrivateType;
|
||||||
if (SymbolGroupValue qoPrivate = v["d_ptr"]["d"].pointerTypeCast(qoPrivateType.c_str())) {
|
const SymbolGroupValue qoPrivate = v["d_ptr"]["d"].pointerTypeCast(qoPrivateType.c_str());
|
||||||
if (SymbolGroupValue oName = qoPrivate["objectName"]) {
|
if (!qoPrivate || !dumpQObjectName(qoPrivate, str))
|
||||||
if (specialInfoIn)
|
return false;
|
||||||
*specialInfoIn = qoPrivate.node();
|
if (specialInfoIn)
|
||||||
dumpQString(oName, str);
|
*specialInfoIn = qoPrivate.node();
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dump the object name
|
// Dump the object name
|
||||||
@@ -2161,15 +2169,11 @@ static inline bool dumpQWindow(const SymbolGroupValue &v, std::wostream &str, vo
|
|||||||
const QtInfo &qtInfo = QtInfo::get(v.context());
|
const QtInfo &qtInfo = QtInfo::get(v.context());
|
||||||
const SymbolGroupValue qwPrivate =
|
const SymbolGroupValue qwPrivate =
|
||||||
qobjectDerivedPrivate(v, qtInfo.qWindowPrivateType, qtInfo);
|
qobjectDerivedPrivate(v, qtInfo.qWindowPrivateType, qtInfo);
|
||||||
if (!qwPrivate)
|
|
||||||
return false;
|
|
||||||
// QWindowPrivate inherits QObjectPrivate
|
// QWindowPrivate inherits QObjectPrivate
|
||||||
const SymbolGroupValue oName = qwPrivate[unsigned(0)]["objectName"]; // QWidgetPrivate inherits QObjectPrivate
|
if (!qwPrivate || !dumpQObjectName(qwPrivate[unsigned(0)], str))
|
||||||
if (!oName)
|
|
||||||
return false;
|
return false;
|
||||||
if (specialInfoIn)
|
if (specialInfoIn)
|
||||||
*specialInfoIn = qwPrivate.node();
|
*specialInfoIn = qwPrivate.node();
|
||||||
dumpQString(oName, str);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user