forked from qt-creator/qt-creator
Debugger: Make use of the "displayedtype" attribute.
Fix "displayedtype" in CDB, display it elsewhere. Log debugger settings in DebuggerManager startup. Acked-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
@@ -187,6 +187,10 @@ static int dumpQVariant()
|
|||||||
prepareInBuffer("QVariant", "local.qvariant", "local.qvariant", "");
|
prepareInBuffer("QVariant", "local.qvariant", "local.qvariant", "");
|
||||||
qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0);
|
qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0);
|
||||||
fputs(qDumpOutBuffer, stdout);
|
fputs(qDumpOutBuffer, stdout);
|
||||||
|
test = QVariant(QRect(1,2, 3, 4));
|
||||||
|
prepareInBuffer("QVariant", "local.qvariant", "local.qvariant", "");
|
||||||
|
qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0);
|
||||||
|
fputs(qDumpOutBuffer, stdout);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -853,6 +853,8 @@ void CdbDebugEngine::updateWatchData(const WatchData &incomplete)
|
|||||||
} while (false);
|
} while (false);
|
||||||
if (!success)
|
if (!success)
|
||||||
warning(msgFunctionFailed(Q_FUNC_INFO, errorMessage));
|
warning(msgFunctionFailed(Q_FUNC_INFO, errorMessage));
|
||||||
|
if (debugCDBWatchHandling > 1)
|
||||||
|
qDebug() << *m_d->m_debuggerManagerAccess->watchHandler()->model(LocalsWatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbDebugEngine::stepExec()
|
void CdbDebugEngine::stepExec()
|
||||||
|
@@ -51,6 +51,16 @@ inline bool falsePredicate(const WatchData & /* whatever */) { return false; }
|
|||||||
inline bool isDumperPredicate(const WatchData &wd)
|
inline bool isDumperPredicate(const WatchData &wd)
|
||||||
{ return wd.source == OwnerDumper; }
|
{ return wd.source == OwnerDumper; }
|
||||||
|
|
||||||
|
static inline void debugWatchDataList(const QList<WatchData> &l, const char *why = 0)
|
||||||
|
{
|
||||||
|
QDebug nospace = qDebug().nospace();
|
||||||
|
if (why)
|
||||||
|
nospace << why << '\n';
|
||||||
|
foreach(const WatchData &wd, l)
|
||||||
|
nospace << wd.toString() << '\n';
|
||||||
|
nospace << '\n';
|
||||||
|
}
|
||||||
|
|
||||||
// Match an item that is expanded in the watchhandler.
|
// Match an item that is expanded in the watchhandler.
|
||||||
class WatchHandlerExpandedPredicate {
|
class WatchHandlerExpandedPredicate {
|
||||||
public:
|
public:
|
||||||
@@ -174,6 +184,7 @@ static inline void fixDumperResult(const WatchData &source,
|
|||||||
const int size = result->size();
|
const int size = result->size();
|
||||||
if (!size)
|
if (!size)
|
||||||
return;
|
return;
|
||||||
|
// debugWatchDataList(*result, suppressGrandChildren ? ">fixDumperResult suppressGrandChildren" : ">fixDumperResult");
|
||||||
WatchData &returned = result->front();
|
WatchData &returned = result->front();
|
||||||
if (returned.iname != source.iname)
|
if (returned.iname != source.iname)
|
||||||
return;
|
return;
|
||||||
@@ -195,6 +206,7 @@ static inline void fixDumperResult(const WatchData &source,
|
|||||||
for (++it; it != wend; ++it) {
|
for (++it; it != wend; ++it) {
|
||||||
WatchData &wd = *it;
|
WatchData &wd = *it;
|
||||||
if (wd.addr.isEmpty() && wd.isSomethingNeeded()) {
|
if (wd.addr.isEmpty() && wd.isSomethingNeeded()) {
|
||||||
|
wd.setHasChildren(false);
|
||||||
wd.setAllUnneeded();
|
wd.setAllUnneeded();
|
||||||
} else {
|
} else {
|
||||||
// Hack: Suppress endless recursion of the model. To be fixed,
|
// Hack: Suppress endless recursion of the model. To be fixed,
|
||||||
@@ -203,6 +215,7 @@ static inline void fixDumperResult(const WatchData &source,
|
|||||||
wd.setHasChildren(false);
|
wd.setHasChildren(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// debugWatchDataList(*result, "<fixDumperResult");
|
||||||
}
|
}
|
||||||
|
|
||||||
WatchHandleDumperInserter &WatchHandleDumperInserter::operator=(WatchData &wd)
|
WatchHandleDumperInserter &WatchHandleDumperInserter::operator=(WatchData &wd)
|
||||||
@@ -314,6 +327,7 @@ bool CdbStackFrameContext::completeData(const WatchData &incompleteLocal,
|
|||||||
WatchData wd = incompleteLocal;
|
WatchData wd = incompleteLocal;
|
||||||
if (wd.isValueNeeded())
|
if (wd.isValueNeeded())
|
||||||
wd.setValue(QCoreApplication::translate("CdbStackFrameContext", "<Unknown>"));
|
wd.setValue(QCoreApplication::translate("CdbStackFrameContext", "<Unknown>"));
|
||||||
|
wd.setHasChildren(false);
|
||||||
wd.setAllUnneeded();
|
wd.setAllUnneeded();
|
||||||
wh->insertData(wd);
|
wh->insertData(wd);
|
||||||
}
|
}
|
||||||
|
@@ -847,6 +847,7 @@ void DebuggerManager::startNewDebugger(DebuggerRunControl *runControl,
|
|||||||
|
|
||||||
emit debugModeRequested();
|
emit debugModeRequested();
|
||||||
showDebuggerOutput(LogStatus, tr("Starting debugger for tool chain '%1'...").arg(toolChainName));
|
showDebuggerOutput(LogStatus, tr("Starting debugger for tool chain '%1'...").arg(toolChainName));
|
||||||
|
showDebuggerOutput(LogDebug, DebuggerSettings::instance()->dump());
|
||||||
|
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QString settingsIdHint;
|
QString settingsIdHint;
|
||||||
|
@@ -1444,7 +1444,6 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
|||||||
QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized,
|
QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized,
|
||||||
initializeVariables());
|
initializeVariables());
|
||||||
|
|
||||||
debugMessage(DebuggerSettings::instance()->dump());
|
|
||||||
QStringList gdbArgs;
|
QStringList gdbArgs;
|
||||||
|
|
||||||
if (m_gdbProc.state() != QProcess::NotRunning) {
|
if (m_gdbProc.state() != QProcess::NotRunning) {
|
||||||
@@ -3288,16 +3287,21 @@ void GdbEngine::handleVarAssign(const GdbResultRecord &, const QVariant &)
|
|||||||
updateLocals();
|
updateLocals();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::setWatchDataType(WatchData &data, const GdbMi &mi)
|
// Find the "type" and "displayedtype" children of root and set up type.
|
||||||
|
void GdbEngine::setWatchDataType(WatchData &data, const GdbMi &root)
|
||||||
{
|
{
|
||||||
if (mi.isValid()) {
|
const GdbMi &typeItem = root.findChild("type");
|
||||||
QString miData = _(mi.data());
|
if (typeItem.isValid()) {
|
||||||
|
const QString miData = _(typeItem.data());
|
||||||
if (!data.framekey.isEmpty())
|
if (!data.framekey.isEmpty())
|
||||||
m_varToType[data.framekey] = miData;
|
m_varToType[data.framekey] = miData;
|
||||||
data.setType(miData);
|
data.setType(miData);
|
||||||
} else if (data.type.isEmpty()) {
|
} else if (data.type.isEmpty()) {
|
||||||
data.setTypeNeeded();
|
data.setTypeNeeded();
|
||||||
}
|
}
|
||||||
|
const GdbMi &displayedTypeItem = root.findChild("displayedtype");
|
||||||
|
if (displayedTypeItem.isValid())
|
||||||
|
data.displayedType = _(displayedTypeItem.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::handleVarCreate(const GdbResultRecord &record,
|
void GdbEngine::handleVarCreate(const GdbResultRecord &record,
|
||||||
@@ -3310,7 +3314,7 @@ void GdbEngine::handleVarCreate(const GdbResultRecord &record,
|
|||||||
//qDebug() << "HANDLE VARIABLE CREATION:" << data.toString();
|
//qDebug() << "HANDLE VARIABLE CREATION:" << data.toString();
|
||||||
if (record.resultClass == GdbResultDone) {
|
if (record.resultClass == GdbResultDone) {
|
||||||
data.variable = data.iname;
|
data.variable = data.iname;
|
||||||
setWatchDataType(data, record.data.findChild("type"));
|
setWatchDataType(data, record.data);
|
||||||
if (hasDebuggingHelperForType(data.type)) {
|
if (hasDebuggingHelperForType(data.type)) {
|
||||||
// we do not trust gdb if we have a custom dumper
|
// we do not trust gdb if we have a custom dumper
|
||||||
if (record.data.findChild("children").isValid())
|
if (record.data.findChild("children").isValid())
|
||||||
@@ -3412,7 +3416,7 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setWatchDataType(data, contents.findChild("type"));
|
setWatchDataType(data, contents);
|
||||||
setWatchDataValue(data, contents.findChild("value"),
|
setWatchDataValue(data, contents.findChild("value"),
|
||||||
contents.findChild("valueencoded").data().toInt());
|
contents.findChild("valueencoded").data().toInt());
|
||||||
setWatchDataAddress(data, contents.findChild("addr"));
|
setWatchDataAddress(data, contents.findChild("addr"));
|
||||||
@@ -3438,7 +3442,7 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record,
|
|||||||
|
|
||||||
// try not to repeat data too often
|
// try not to repeat data too often
|
||||||
WatchData childtemplate;
|
WatchData childtemplate;
|
||||||
setWatchDataType(childtemplate, contents.findChild("childtype"));
|
setWatchDataType(childtemplate, contents);
|
||||||
setWatchDataChildCount(childtemplate, contents.findChild("childnumchild"));
|
setWatchDataChildCount(childtemplate, contents.findChild("childnumchild"));
|
||||||
//qDebug() << "DATA:" << data.toString();
|
//qDebug() << "DATA:" << data.toString();
|
||||||
|
|
||||||
@@ -3466,7 +3470,7 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record,
|
|||||||
//data1.name += " (" + skey + ")";
|
//data1.name += " (" + skey + ")";
|
||||||
data1.name = skey;
|
data1.name = skey;
|
||||||
}
|
}
|
||||||
setWatchDataType(data1, item.findChild("type"));
|
setWatchDataType(data1, item);
|
||||||
setWatchDataExpression(data1, item.findChild("exp"));
|
setWatchDataExpression(data1, item.findChild("exp"));
|
||||||
setWatchDataChildCount(data1, item.findChild("numchild"));
|
setWatchDataChildCount(data1, item.findChild("numchild"));
|
||||||
setWatchDataValue(data1, item.findChild("value"),
|
setWatchDataValue(data1, item.findChild("value"),
|
||||||
@@ -3668,7 +3672,7 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals)
|
|||||||
data.name = nam;
|
data.name = nam;
|
||||||
data.exp = nam;
|
data.exp = nam;
|
||||||
data.framekey = m_currentFrame + data.name;
|
data.framekey = m_currentFrame + data.name;
|
||||||
setWatchDataType(data, item.findChild("type"));
|
setWatchDataType(data, item);
|
||||||
// set value only directly if it is simple enough, otherwise
|
// set value only directly if it is simple enough, otherwise
|
||||||
// pass through the insertData() machinery
|
// pass through the insertData() machinery
|
||||||
if (isIntOrFloatType(data.type) || isPointerType(data.type))
|
if (isIntOrFloatType(data.type) || isPointerType(data.type))
|
||||||
@@ -3725,7 +3729,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
|
|||||||
data.name = _(exp);
|
data.name = _(exp);
|
||||||
data.iname = parent.iname + _c('.') + data.name;
|
data.iname = parent.iname + _c('.') + data.name;
|
||||||
data.variable = _(name);
|
data.variable = _(name);
|
||||||
setWatchDataType(data, item.findChild("type"));
|
setWatchDataType(data, item);
|
||||||
setWatchDataValue(data, item.findChild("value"));
|
setWatchDataValue(data, item.findChild("value"));
|
||||||
setWatchDataAddress(data, item.findChild("addr"));
|
setWatchDataAddress(data, item.findChild("addr"));
|
||||||
setWatchDataSAddress(data, item.findChild("saddr"));
|
setWatchDataSAddress(data, item.findChild("saddr"));
|
||||||
@@ -3747,7 +3751,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
|
|||||||
WatchData data;
|
WatchData data;
|
||||||
data.iname = parent.iname + _c('.') + __(exp);
|
data.iname = parent.iname + _c('.') + __(exp);
|
||||||
data.variable = _(name);
|
data.variable = _(name);
|
||||||
setWatchDataType(data, item.findChild("type"));
|
setWatchDataType(data, item);
|
||||||
setWatchDataValue(data, item.findChild("value"));
|
setWatchDataValue(data, item.findChild("value"));
|
||||||
setWatchDataAddress(data, item.findChild("addr"));
|
setWatchDataAddress(data, item.findChild("addr"));
|
||||||
setWatchDataSAddress(data, item.findChild("saddr"));
|
setWatchDataSAddress(data, item.findChild("saddr"));
|
||||||
|
@@ -246,6 +246,17 @@ static void formatToolTipRow(QTextStream &str, const QString &category, const QS
|
|||||||
<< Qt::escape(value) << "</td></tr>";
|
<< Qt::escape(value) << "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline QString typeToolTip(const WatchData &wd)
|
||||||
|
{
|
||||||
|
if (wd.displayedType.isEmpty())
|
||||||
|
return wd.type;
|
||||||
|
QString rc = wd.displayedType;
|
||||||
|
rc += QLatin1String(" (");
|
||||||
|
rc += wd.type;
|
||||||
|
rc += QLatin1Char(')');
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
QString WatchData::toToolTip() const
|
QString WatchData::toToolTip() const
|
||||||
{
|
{
|
||||||
if (!valuetooltip.isEmpty())
|
if (!valuetooltip.isEmpty())
|
||||||
@@ -254,7 +265,7 @@ QString WatchData::toToolTip() const
|
|||||||
QTextStream str(&res);
|
QTextStream str(&res);
|
||||||
str << "<html><body><table>";
|
str << "<html><body><table>";
|
||||||
formatToolTipRow(str, WatchHandler::tr("Expression"), exp);
|
formatToolTipRow(str, WatchHandler::tr("Expression"), exp);
|
||||||
formatToolTipRow(str, WatchHandler::tr("Type"), type);
|
formatToolTipRow(str, WatchHandler::tr("Type"), typeToolTip(*this));
|
||||||
QString val = value;
|
QString val = value;
|
||||||
if (value.size() > 1000) {
|
if (value.size() > 1000) {
|
||||||
val.truncate(1000);
|
val.truncate(1000);
|
||||||
@@ -629,7 +640,10 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
|
|||||||
case 1: return formattedValue(data,
|
case 1: return formattedValue(data,
|
||||||
m_handler->m_individualFormats[data.iname],
|
m_handler->m_individualFormats[data.iname],
|
||||||
m_handler->m_typeFormats[data.type]);
|
m_handler->m_typeFormats[data.type]);
|
||||||
case 2: return niceType(data.type);
|
case 2:
|
||||||
|
if (!data.displayedType.isEmpty())
|
||||||
|
return data.displayedType;
|
||||||
|
return niceType(data.type);
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -886,6 +900,21 @@ WatchItem *WatchModel::findItem(const QString &iname, WatchItem *root) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void debugRecursion(QDebug &d, const WatchItem *item, int depth)
|
||||||
|
{
|
||||||
|
d << QString(2 * depth, QLatin1Char(' ')) << item->toString() << '\n';
|
||||||
|
foreach(const WatchItem *i, item->children)
|
||||||
|
debugRecursion(d, i, depth + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug d, const WatchModel &m)
|
||||||
|
{
|
||||||
|
QDebug nospace = d.nospace();
|
||||||
|
if (m.m_root)
|
||||||
|
debugRecursion(nospace, m.m_root, 0);
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
@@ -39,6 +39,10 @@
|
|||||||
#include <QtGui/QTreeView>
|
#include <QtGui/QTreeView>
|
||||||
#include <QtScript/QScriptValue>
|
#include <QtScript/QScriptValue>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QDebug;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -115,7 +119,8 @@ public:
|
|||||||
QString value; // displayed value
|
QString value; // displayed value
|
||||||
QByteArray editvalue; // displayed value
|
QByteArray editvalue; // displayed value
|
||||||
QString valuetooltip; // tooltip in value column
|
QString valuetooltip; // tooltip in value column
|
||||||
QString type; // displayed type
|
QString type; // type for further processing
|
||||||
|
QString displayedType; // displayed type (optional)
|
||||||
QString variable; // name of internal Gdb variable if created
|
QString variable; // name of internal Gdb variable if created
|
||||||
QString addr; // displayed adress
|
QString addr; // displayed adress
|
||||||
QString saddr; // stored address (pointer in container)
|
QString saddr; // stored address (pointer in container)
|
||||||
@@ -199,6 +204,7 @@ private:
|
|||||||
void emitDataChanged(int column,
|
void emitDataChanged(int column,
|
||||||
const QModelIndex &parentIndex = QModelIndex());
|
const QModelIndex &parentIndex = QModelIndex());
|
||||||
|
|
||||||
|
friend QDebug operator<<(QDebug d, const WatchModel &m);
|
||||||
private:
|
private:
|
||||||
WatchHandler *m_handler;
|
WatchHandler *m_handler;
|
||||||
WatchType m_type;
|
WatchType m_type;
|
||||||
|
@@ -56,7 +56,6 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
enum { debug = 0 };
|
enum { debug = 0 };
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -528,7 +527,9 @@ QList<WatchData> QtDumperResult::toWatchData(int source) const
|
|||||||
root.setValue(decodeData(value, valueEncoded));
|
root.setValue(decodeData(value, valueEncoded));
|
||||||
root.valuedisabled = valuedisabled;
|
root.valuedisabled = valuedisabled;
|
||||||
}
|
}
|
||||||
root.setType(displayedType.isEmpty() ? type : displayedType);
|
root.setType(type);
|
||||||
|
if (!displayedType.isEmpty())
|
||||||
|
root.displayedType = displayedType;
|
||||||
root.setAddress(address);
|
root.setAddress(address);
|
||||||
root.source = source;
|
root.source = source;
|
||||||
if (childCount >= 0)
|
if (childCount >= 0)
|
||||||
@@ -570,21 +571,20 @@ QList<WatchData> QtDumperResult::toWatchData(int source) const
|
|||||||
wchild.setAddress(dchild.address);
|
wchild.setAddress(dchild.address);
|
||||||
// The type setter sets hasChildren for known types.
|
// The type setter sets hasChildren for known types.
|
||||||
wchild.setType(dchild.type.isEmpty() ? childType : dchild.type);
|
wchild.setType(dchild.type.isEmpty() ? childType : dchild.type);
|
||||||
if (wchild.isHasChildrenNeeded()) {
|
if (!dchild.displayedType.isEmpty())
|
||||||
// Child overrides.
|
wchild.displayedType = dchild.displayedType;
|
||||||
const int effectiveChildChildCount = dchild.childCount == -1 ? childChildCount : dchild.childCount;
|
// Child overrides.
|
||||||
switch (effectiveChildChildCount) {
|
const int effectiveChildChildCount = dchild.childCount == -1 ? childChildCount : dchild.childCount;
|
||||||
case -1:
|
switch (effectiveChildChildCount) {
|
||||||
wchild.setChildrenNeeded();
|
case -1: // In this case, trust WatchData::setType().
|
||||||
wchild.setHasChildrenNeeded();
|
break;
|
||||||
break;
|
case 0:
|
||||||
case 0:
|
wchild.setHasChildren(false);
|
||||||
wchild.setHasChildren(false);
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
wchild.setHasChildren(true);
|
||||||
wchild.setHasChildren(true);
|
wchild.setChildrenNeeded();
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -904,7 +904,7 @@ bool DumperParser::run()
|
|||||||
{
|
{
|
||||||
const char *ptr = m_s;
|
const char *ptr = m_s;
|
||||||
const bool rc = parseHash(0, ptr);
|
const bool rc = parseHash(0, ptr);
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
qDebug() << Q_FUNC_INFO << '\n' << m_s << rc;
|
qDebug() << Q_FUNC_INFO << '\n' << m_s << rc;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -988,35 +988,35 @@ bool DumperParser::parseValue(int level, const char *&pos)
|
|||||||
|
|
||||||
bool DumperParser::handleKeyword(const char *k, int size)
|
bool DumperParser::handleKeyword(const char *k, int size)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
qDebug() << Q_FUNC_INFO << '\n' << QByteArray(k, size);
|
qDebug() << Q_FUNC_INFO << '\n' << QByteArray(k, size);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DumperParser::handleListStart()
|
bool DumperParser::handleListStart()
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DumperParser::handleListEnd()
|
bool DumperParser::handleListEnd()
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DumperParser::handleHashStart()
|
bool DumperParser::handleHashStart()
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DumperParser::handleHashEnd()
|
bool DumperParser::handleHashEnd()
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -1024,7 +1024,7 @@ bool DumperParser::handleHashEnd()
|
|||||||
|
|
||||||
bool DumperParser::handleValue(const char *k, int size)
|
bool DumperParser::handleValue(const char *k, int size)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
qDebug() << Q_FUNC_INFO << '\n' << QByteArray(k, size);
|
qDebug() << Q_FUNC_INFO << '\n' << QByteArray(k, size);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1513,6 +1513,7 @@ private:
|
|||||||
ChildModeStart,
|
ChildModeStart,
|
||||||
ExpectingChildren,ExpectingChildName, ExpectingChildAddress,
|
ExpectingChildren,ExpectingChildName, ExpectingChildAddress,
|
||||||
ExpectingChildExpression, ExpectingChildType,
|
ExpectingChildExpression, ExpectingChildType,
|
||||||
|
ExpectingChildDisplayedType,
|
||||||
ExpectingChildKey, ExpectingChildKeyEncoded,
|
ExpectingChildKey, ExpectingChildKeyEncoded,
|
||||||
ExpectingChildValue, ExpectingChildValueEncoded,
|
ExpectingChildValue, ExpectingChildValueEncoded,
|
||||||
ExpectingChildValueDisabled, ExpectingChildChildCount,
|
ExpectingChildValueDisabled, ExpectingChildChildCount,
|
||||||
@@ -1582,7 +1583,7 @@ ValueDumperParser::Mode ValueDumperParser::nextMode(Mode in, const char *keyword
|
|||||||
if (!qstrncmp(keyword, "valuedisabled", size))
|
if (!qstrncmp(keyword, "valuedisabled", size))
|
||||||
return in > ChildModeStart ? ExpectingChildValueDisabled : ExpectingValueDisabled;
|
return in > ChildModeStart ? ExpectingChildValueDisabled : ExpectingValueDisabled;
|
||||||
if (!qstrncmp(keyword, "displayedtype", size))
|
if (!qstrncmp(keyword, "displayedtype", size))
|
||||||
return ExpectingDisplayedType;
|
return in > ChildModeStart ? ExpectingChildDisplayedType : ExpectingDisplayedType;
|
||||||
if (!qstrncmp(keyword, "childnumchild", size))
|
if (!qstrncmp(keyword, "childnumchild", size))
|
||||||
return ExpectingChildChildOverrideCount;
|
return ExpectingChildChildOverrideCount;
|
||||||
break;
|
break;
|
||||||
@@ -1687,6 +1688,9 @@ bool ValueDumperParser::handleValue(const char *k, int size)
|
|||||||
case ExpectingChildType:
|
case ExpectingChildType:
|
||||||
m_result.children.back().type = QString::fromLatin1(valueBA);
|
m_result.children.back().type = QString::fromLatin1(valueBA);
|
||||||
break;
|
break;
|
||||||
|
case ExpectingChildDisplayedType:
|
||||||
|
m_result.children.back().displayedType = QString::fromLatin1(valueBA);
|
||||||
|
break;
|
||||||
case ExpectingChildChildCount:
|
case ExpectingChildChildCount:
|
||||||
m_result.children.back().childCount = QString::fromLatin1(valueBA).toInt();
|
m_result.children.back().childCount = QString::fromLatin1(valueBA).toInt();
|
||||||
break;
|
break;
|
||||||
@@ -1704,7 +1708,7 @@ bool QtDumperHelper::parseValue(const char *data, QtDumperResult *r)
|
|||||||
// Sanity
|
// Sanity
|
||||||
if (!r->children.empty() && r->childCount != r->children.size())
|
if (!r->children.empty() && r->childCount != r->children.size())
|
||||||
r->childCount = r->children.size();
|
r->childCount = r->children.size();
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
qDebug() << '\n' << data << '\n' << *r;
|
qDebug() << '\n' << data << '\n' << *r;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -102,6 +102,7 @@ struct QtDumperResult
|
|||||||
QString address;
|
QString address;
|
||||||
QString exp;
|
QString exp;
|
||||||
QString type;
|
QString type;
|
||||||
|
QString displayedType;
|
||||||
QByteArray key;
|
QByteArray key;
|
||||||
bool valueEncountered;
|
bool valueEncountered;
|
||||||
QByteArray value;
|
QByteArray value;
|
||||||
|
Reference in New Issue
Block a user