Commit 9b8b8ba9 authored by hjk's avatar hjk Committed by David Schulz

Debugger: Replace GdbMi::findChild() with an operator[]

Less noise.

Change-Id: I8e533c97207ff5b9c79182c4fb99993f1992154f
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 7ac0cb62
...@@ -1821,14 +1821,14 @@ void CdbEngine::handlePid(const CdbExtensionCommandPtr &reply) ...@@ -1821,14 +1821,14 @@ void CdbEngine::handlePid(const CdbExtensionCommandPtr &reply)
static Register parseRegister(const GdbMi &gdbmiReg) static Register parseRegister(const GdbMi &gdbmiReg)
{ {
Register reg; Register reg;
reg.name = gdbmiReg.findChild("name").data(); reg.name = gdbmiReg["name"].data();
const GdbMi description = gdbmiReg.findChild("description"); const GdbMi description = gdbmiReg["description"];
if (description.type() != GdbMi::Invalid) { if (description.type() != GdbMi::Invalid) {
reg.name += " ("; reg.name += " (";
reg.name += description.data(); reg.name += description.data();
reg.name += ')'; reg.name += ')';
} }
reg.value = gdbmiReg.findChild("value").data(); reg.value = gdbmiReg["value"].data();
return reg; return reg;
} }
...@@ -1842,11 +1842,11 @@ void CdbEngine::handleModules(const CdbExtensionCommandPtr &reply) ...@@ -1842,11 +1842,11 @@ void CdbEngine::handleModules(const CdbExtensionCommandPtr &reply)
modules.reserve(value.childCount()); modules.reserve(value.childCount());
foreach (const GdbMi &gdbmiModule, value.children()) { foreach (const GdbMi &gdbmiModule, value.children()) {
Module module; Module module;
module.moduleName = QString::fromLatin1(gdbmiModule.findChild("name").data()); module.moduleName = QString::fromLatin1(gdbmiModule["name"].data());
module.modulePath = QString::fromLatin1(gdbmiModule.findChild("image").data()); module.modulePath = QString::fromLatin1(gdbmiModule["image"].data());
module.startAddress = gdbmiModule.findChild("start").data().toULongLong(0, 0); module.startAddress = gdbmiModule["start"].data().toULongLong(0, 0);
module.endAddress = gdbmiModule.findChild("end").data().toULongLong(0, 0); module.endAddress = gdbmiModule["end"].data().toULongLong(0, 0);
if (gdbmiModule.findChild("deferred").type() == GdbMi::Invalid) if (gdbmiModule["deferred"].type() == GdbMi::Invalid)
module.symbolsRead = Module::ReadOk; module.symbolsRead = Module::ReadOk;
modules.push_back(module); modules.push_back(module);
} }
...@@ -1902,8 +1902,8 @@ void CdbEngine::handleLocals(const CdbExtensionCommandPtr &reply) ...@@ -1902,8 +1902,8 @@ void CdbEngine::handleLocals(const CdbExtensionCommandPtr &reply)
// Courtesy of GDB engine // Courtesy of GDB engine
foreach (const GdbMi &child, root.children()) { foreach (const GdbMi &child, root.children()) {
WatchData dummy; WatchData dummy;
dummy.iname = child.findChild("iname").data(); dummy.iname = child["iname"].data();
dummy.name = QLatin1String(child.findChild("name").data()); dummy.name = QLatin1String(child["name"].data());
parseWatchData(watchHandler()->expandedINames(), dummy, child, &watchData); parseWatchData(watchHandler()->expandedINames(), dummy, child, &watchData);
} }
// Fix the names of watch data. // Fix the names of watch data.
...@@ -2023,7 +2023,7 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason, ...@@ -2023,7 +2023,7 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason,
rc |= StopShutdownInProgress; rc |= StopShutdownInProgress;
if (debug) if (debug)
qDebug("%s", stopReason.toString(true, 4).constData()); qDebug("%s", stopReason.toString(true, 4).constData());
const QByteArray reason = stopReason.findChild("reason").data(); const QByteArray reason = stopReason["reason"].data();
if (reason.isEmpty()) { if (reason.isEmpty()) {
*message = tr("Malformed stop response received."); *message = tr("Malformed stop response received.");
rc |= StopReportParseError|StopNotifyStop; rc |= StopReportParseError|StopNotifyStop;
...@@ -2036,12 +2036,12 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason, ...@@ -2036,12 +2036,12 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason,
rc |= StopReportLog; rc |= StopReportLog;
return rc; return rc;
} }
const int threadId = stopReason.findChild("threadId").data().toInt(); const int threadId = stopReason["threadId"].data().toInt();
if (reason == "breakpoint") { if (reason == "breakpoint") {
// Note: Internal breakpoints (run to line) are reported with id=0. // Note: Internal breakpoints (run to line) are reported with id=0.
// Step out creates temporary breakpoints with id 10000. // Step out creates temporary breakpoints with id 10000.
int number = 0; int number = 0;
BreakpointModelId id = cdbIdToBreakpointModelId(stopReason.findChild("breakpointId")); BreakpointModelId id = cdbIdToBreakpointModelId(stopReason["breakpointId"]);
if (id.isValid()) { if (id.isValid()) {
if (breakHandler()->engineBreakpointIds(this).contains(id)) { if (breakHandler()->engineBreakpointIds(this).contains(id)) {
const BreakpointResponse parameters = breakHandler()->response(id); const BreakpointResponse parameters = breakHandler()->response(id);
...@@ -2211,7 +2211,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT ...@@ -2211,7 +2211,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
// Re-fetch stack again. // Re-fetch stack again.
postCommandSequence(CommandListStack); postCommandSequence(CommandListStack);
} else { } else {
const GdbMi stack = stopReason.findChild("stack"); const GdbMi stack = stopReason["stack"];
if (stack.isValid()) { if (stack.isValid()) {
switch (parseStackTrace(stack, sourceStepInto)) { switch (parseStackTrace(stack, sourceStepInto)) {
case ParseStackStepInto: // Hit on a frame while step into, see parseStackTrace(). case ParseStackStepInto: // Hit on a frame while step into, see parseStackTrace().
...@@ -2222,16 +2222,16 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT ...@@ -2222,16 +2222,16 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
return; return;
} }
} else { } else {
showMessage(QString::fromLatin1(stopReason.findChild("stackerror").data()), LogError); showMessage(QString::fromLatin1(stopReason["stackerror"].data()), LogError);
} }
} }
const GdbMi threads = stopReason.findChild("threads"); const GdbMi threads = stopReason["threads"];
if (threads.isValid()) { if (threads.isValid()) {
threadsHandler()->updateThreads(threads); threadsHandler()->updateThreads(threads);
if (forcedThreadId.isValid()) if (forcedThreadId.isValid())
threadsHandler()->setCurrentThread(forcedThreadId); threadsHandler()->setCurrentThread(forcedThreadId);
} else { } else {
showMessage(QString::fromLatin1(stopReason.findChild("threaderror").data()), LogError); showMessage(QString::fromLatin1(stopReason["threaderror"].data()), LogError);
} }
// Fire off remaining commands asynchronously // Fire off remaining commands asynchronously
if (!m_pendingBreakpointMap.isEmpty()) if (!m_pendingBreakpointMap.isEmpty())
...@@ -2839,15 +2839,15 @@ static StackFrames parseFrames(const GdbMi &gdbmi, bool *incomplete = 0) ...@@ -2839,15 +2839,15 @@ static StackFrames parseFrames(const GdbMi &gdbmi, bool *incomplete = 0)
} }
StackFrame frame; StackFrame frame;
frame.level = i; frame.level = i;
const GdbMi fullName = frameMi.findChild("fullname"); const GdbMi fullName = frameMi["fullname"];
if (fullName.isValid()) { if (fullName.isValid()) {
frame.file = QFile::decodeName(fullName.data()); frame.file = QFile::decodeName(fullName.data());
frame.line = frameMi.findChild("line").data().toInt(); frame.line = frameMi["line"].data().toInt();
frame.usable = false; // To be decided after source path mapping. frame.usable = false; // To be decided after source path mapping.
} }
frame.function = QLatin1String(frameMi.findChild("func").data()); frame.function = QLatin1String(frameMi["func"].data());
frame.from = QLatin1String(frameMi.findChild("from").data()); frame.from = QLatin1String(frameMi["from"].data());
frame.address = frameMi.findChild("addr").data().toULongLong(0, 16); frame.address = frameMi["addr"].data().toULongLong(0, 16);
rc.push_back(frame); rc.push_back(frame);
} }
return rc; return rc;
......
...@@ -298,7 +298,7 @@ static inline bool parseThread(QByteArray line, ThreadData *thread, bool *curren ...@@ -298,7 +298,7 @@ static inline bool parseThread(QByteArray line, ThreadData *thread, bool *curren
// Helper to retrieve an int child from GDBMI // Helper to retrieve an int child from GDBMI
static inline bool gdbmiChildToInt(const GdbMi &parent, const char *childName, int *target) static inline bool gdbmiChildToInt(const GdbMi &parent, const char *childName, int *target)
{ {
const GdbMi childBA = parent.findChild(childName); const GdbMi childBA = parent[childName];
if (childBA.isValid()) { if (childBA.isValid()) {
bool ok; bool ok;
const int v = childBA.data().toInt(&ok); const int v = childBA.data().toInt(&ok);
...@@ -313,7 +313,7 @@ static inline bool gdbmiChildToInt(const GdbMi &parent, const char *childName, i ...@@ -313,7 +313,7 @@ static inline bool gdbmiChildToInt(const GdbMi &parent, const char *childName, i
// Helper to retrieve an bool child from GDBMI // Helper to retrieve an bool child from GDBMI
static inline bool gdbmiChildToBool(const GdbMi &parent, const char *childName, bool *target) static inline bool gdbmiChildToBool(const GdbMi &parent, const char *childName, bool *target)
{ {
const GdbMi childBA = parent.findChild(childName); const GdbMi childBA = parent[childName];
if (childBA.isValid()) { if (childBA.isValid()) {
*target = childBA.data() == "true"; *target = childBA.data() == "true";
return true; return true;
...@@ -331,16 +331,16 @@ void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r, ...@@ -331,16 +331,16 @@ void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r,
gdbmiChildToBool(gdbmi, "deferred", &(r->pending)); gdbmiChildToBool(gdbmi, "deferred", &(r->pending));
r->id = BreakpointResponseId(); r->id = BreakpointResponseId();
// Might not be valid if there is not id // Might not be valid if there is not id
r->id = cdbIdToBreakpointResponseId(gdbmi.findChild("id")); r->id = cdbIdToBreakpointResponseId(gdbmi["id"]);
const GdbMi moduleG = gdbmi.findChild("module"); const GdbMi moduleG = gdbmi["module"];
if (moduleG.isValid()) if (moduleG.isValid())
r->module = QString::fromLocal8Bit(moduleG.data()); r->module = QString::fromLocal8Bit(moduleG.data());
if (expression) { if (expression) {
const GdbMi expressionG = gdbmi.findChild("expression"); const GdbMi expressionG = gdbmi["expression"];
if (expressionG.isValid()) if (expressionG.isValid())
*expression = QString::fromLocal8Bit(expressionG.data()); *expression = QString::fromLocal8Bit(expressionG.data());
} }
const GdbMi addressG = gdbmi.findChild("address"); const GdbMi addressG = gdbmi["address"];
if (addressG.isValid()) if (addressG.isValid())
r->address = addressG.data().toULongLong(0, 0); r->address = addressG.data().toULongLong(0, 0);
if (gdbmiChildToInt(gdbmi, "passcount", &(r->ignoreCount))) if (gdbmiChildToInt(gdbmi, "passcount", &(r->ignoreCount)))
...@@ -410,23 +410,23 @@ WinException::WinException() : ...@@ -410,23 +410,23 @@ WinException::WinException() :
void WinException::fromGdbMI(const GdbMi &gdbmi) void WinException::fromGdbMI(const GdbMi &gdbmi)
{ {
exceptionCode = gdbmi.findChild("exceptionCode").data().toUInt(); exceptionCode = gdbmi["exceptionCode"].data().toUInt();
exceptionFlags = gdbmi.findChild("exceptionFlags").data().toUInt(); exceptionFlags = gdbmi["exceptionFlags"].data().toUInt();
exceptionAddress = gdbmi.findChild("exceptionAddress").data().toULongLong(); exceptionAddress = gdbmi["exceptionAddress"].data().toULongLong();
firstChance = gdbmi.findChild("firstChance").data() != "0"; firstChance = gdbmi["firstChance"].data() != "0";
const GdbMi ginfo1 = gdbmi.findChild("exceptionInformation0"); const GdbMi ginfo1 = gdbmi["exceptionInformation0"];
if (ginfo1.isValid()) { if (ginfo1.isValid()) {
info1 = ginfo1.data().toULongLong(); info1 = ginfo1.data().toULongLong();
const GdbMi ginfo2 = gdbmi.findChild("exceptionInformation1"); const GdbMi ginfo2 = gdbmi["exceptionInformation1"];
if (ginfo2.isValid()) if (ginfo2.isValid())
info2 = ginfo1.data().toULongLong(); info2 = ginfo1.data().toULongLong();
} }
const GdbMi gLineNumber = gdbmi.findChild("exceptionLine"); const GdbMi gLineNumber = gdbmi["exceptionLine"];
if (gLineNumber.isValid()) { if (gLineNumber.isValid()) {
lineNumber = gLineNumber.data().toInt(); lineNumber = gLineNumber.data().toInt();
file = gdbmi.findChild("exceptionFile").data(); file = gdbmi["exceptionFile"].data();
} }
function = gdbmi.findChild("exceptionFunction").data(); function = gdbmi["exceptionFunction"].data();
} }
QString WinException::toString(bool includeLocation) const QString WinException::toString(bool includeLocation) const
......
...@@ -331,9 +331,9 @@ void GdbMi::fromStringMultiple(const QByteArray &ba) ...@@ -331,9 +331,9 @@ void GdbMi::fromStringMultiple(const QByteArray &ba)
parseTuple_helper(from, to); parseTuple_helper(from, to);
} }
GdbMi GdbMi::findChild(const char *name) const GdbMi GdbMi::operator[](const char *name) const
{ {
for (int i = 0; i < m_children.size(); ++i) for (int i = 0, n = m_children.size(); i < n; ++i)
if (m_children.at(i).m_name == name) if (m_children.at(i).m_name == name)
return m_children.at(i); return m_children.at(i);
return GdbMi(); return GdbMi();
......
...@@ -119,7 +119,7 @@ public: ...@@ -119,7 +119,7 @@ public:
const GdbMi &childAt(int index) const { return m_children[index]; } const GdbMi &childAt(int index) const { return m_children[index]; }
GdbMi &childAt(int index) { return m_children[index]; } GdbMi &childAt(int index) { return m_children[index]; }
GdbMi findChild(const char *name) const; GdbMi operator[](const char *name) const;
QByteArray toString(bool multiline = false, int indent = 0) const; QByteArray toString(bool multiline = false, int indent = 0) const;
qulonglong toAddress() const; qulonglong toAddress() const;
......
...@@ -65,7 +65,7 @@ void GdbAbstractPlainEngine::handleFileExecAndSymbols(const GdbResponse &respons ...@@ -65,7 +65,7 @@ void GdbAbstractPlainEngine::handleFileExecAndSymbols(const GdbResponse &respons
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
handleInferiorPrepared(); handleInferiorPrepared();
} else { } else {
QByteArray ba = response.data.findChild("msg").data(); QByteArray ba = response.data["msg"].data();
QString msg = fromLocalEncoding(ba); QString msg = fromLocalEncoding(ba);
// Extend the message a bit in unknown cases. // Extend the message a bit in unknown cases.
if (!ba.endsWith("File format not recognized")) if (!ba.endsWith("File format not recognized"))
...@@ -92,7 +92,7 @@ void GdbAbstractPlainEngine::handleExecRun(const GdbResponse &response) ...@@ -92,7 +92,7 @@ void GdbAbstractPlainEngine::handleExecRun(const GdbResponse &response)
if (debuggerCore()->boolSetting(EnableReverseDebugging)) if (debuggerCore()->boolSetting(EnableReverseDebugging))
postCommand("target record"); postCommand("target record");
} else { } else {
QString msg = fromLocalEncoding(response.data.findChild("msg").data()); QString msg = fromLocalEncoding(response.data["msg"].data());
//QTC_CHECK(status() == InferiorRunOk); //QTC_CHECK(status() == InferiorRunOk);
//interruptInferior(); //interruptInferior();
showMessage(msg); showMessage(msg);
......
...@@ -96,13 +96,13 @@ void GdbAttachEngine::handleAttach(const GdbResponse &response) ...@@ -96,13 +96,13 @@ void GdbAttachEngine::handleAttach(const GdbResponse &response)
handleInferiorPrepared(); handleInferiorPrepared();
break; break;
case GdbResultError: case GdbResultError:
if (response.data.findChild("msg").data() == "ptrace: Operation not permitted.") { if (response.data["msg"].data() == "ptrace: Operation not permitted.") {
notifyInferiorSetupFailed(DumperHelper::msgPtraceError(startParameters().startMode)); notifyInferiorSetupFailed(DumperHelper::msgPtraceError(startParameters().startMode));
break; break;
} }
// if msg != "ptrace: ..." fall through // if msg != "ptrace: ..." fall through
default: default:
QString msg = QString::fromLocal8Bit(response.data.findChild("msg").data()); QString msg = QString::fromLocal8Bit(response.data["msg"].data());
notifyInferiorSetupFailed(msg); notifyInferiorSetupFailed(msg);
} }
} }
......
...@@ -271,7 +271,7 @@ static QByteArray qClassName(const QByteArray &qtNamespace, const char *classNam ...@@ -271,7 +271,7 @@ static QByteArray qClassName(const QByteArray &qtNamespace, const char *classNam
static double getDumperVersion(const GdbMi &contents) static double getDumperVersion(const GdbMi &contents)
{ {
const GdbMi dumperVersionG = contents.findChild("dumperversion"); const GdbMi dumperVersionG = contents["dumperversion"];
if (dumperVersionG.type() != GdbMi::Invalid) { if (dumperVersionG.type() != GdbMi::Invalid) {
bool ok; bool ok;
const double v = QString::fromLatin1(dumperVersionG.data()).toDouble(&ok); const double v = QString::fromLatin1(dumperVersionG.data()).toDouble(&ok);
...@@ -302,10 +302,10 @@ bool DumperHelper::parseQuery(const GdbMi &contents) ...@@ -302,10 +302,10 @@ bool DumperHelper::parseQuery(const GdbMi &contents)
qDebug() << "parseQuery" << contents.toString(true, 2); qDebug() << "parseQuery" << contents.toString(true, 2);
// Common info, dumper version, etc // Common info, dumper version, etc
QByteArray ns = contents.findChild("namespace").data(); QByteArray ns = contents["namespace"].data();
setQtNamespace(ns); setQtNamespace(ns);
int qtv = 0; int qtv = 0;
const GdbMi qtversion = contents.findChild("qtversion"); const GdbMi qtversion = contents["qtversion"];
if (qtversion.children().size() == 3) { if (qtversion.children().size() == 3) {
qtv = (qtversion.childAt(0).data().toInt() << 16) qtv = (qtversion.childAt(0).data().toInt() << 16)
+ (qtversion.childAt(1).data().toInt() << 8) + (qtversion.childAt(1).data().toInt() << 8)
...@@ -314,7 +314,7 @@ bool DumperHelper::parseQuery(const GdbMi &contents) ...@@ -314,7 +314,7 @@ bool DumperHelper::parseQuery(const GdbMi &contents)
m_qtVersion = qtv; m_qtVersion = qtv;
// Get list of helpers // Get list of helpers
QByteArrayList availableSimpleDebuggingHelpers; QByteArrayList availableSimpleDebuggingHelpers;
foreach (const GdbMi &item, contents.findChild("dumpers").children()) foreach (const GdbMi &item, contents["dumpers"].children())
availableSimpleDebuggingHelpers.append(item.data()); availableSimpleDebuggingHelpers.append(item.data());
// Parse types // Parse types
...@@ -326,7 +326,7 @@ bool DumperHelper::parseQuery(const GdbMi &contents) ...@@ -326,7 +326,7 @@ bool DumperHelper::parseQuery(const GdbMi &contents)
m_dumperVersion = getDumperVersion(contents); m_dumperVersion = getDumperVersion(contents);
// Parse sizes // Parse sizes
foreach (const GdbMi &sizesList, contents.findChild("sizes").children()) { foreach (const GdbMi &sizesList, contents["sizes"].children()) {
const int childCount = sizesList.childCount(); const int childCount = sizesList.childCount();
if (childCount > 1) { if (childCount > 1) {
const int size = sizesList.childAt(0).data().toInt(); const int size = sizesList.childAt(0).data().toInt();
...@@ -335,7 +335,7 @@ bool DumperHelper::parseQuery(const GdbMi &contents) ...@@ -335,7 +335,7 @@ bool DumperHelper::parseQuery(const GdbMi &contents)
} }
} }
// Parse expressions // Parse expressions
foreach (const GdbMi &exprList, contents.findChild("expressions").children()) foreach (const GdbMi &exprList, contents["expressions"].children())
if (exprList.childCount() == 2) if (exprList.childCount() == 2)
m_expressionCache.insert(exprList.childAt(0).data(), m_expressionCache.insert(exprList.childAt(0).data(),
exprList.childAt(1).data()); exprList.childAt(1).data());
...@@ -1011,8 +1011,8 @@ void GdbEngine::handleDebuggingHelperValue2Classic(const GdbResponse &response) ...@@ -1011,8 +1011,8 @@ void GdbEngine::handleDebuggingHelperValue2Classic(const GdbResponse &response)
return; return;
} }
data.updateType(response.data.findChild("type")); data.updateType(response.data["type"]);
data.updateDisplayedType(response.data.findChild("displaytype")); data.updateDisplayedType(response.data["displaytype"]);
QList<WatchData> list; QList<WatchData> list;
parseWatchData(watchHandler()->expandedINames(), data, contents, &list); parseWatchData(watchHandler()->expandedINames(), data, contents, &list);
//for (int i = 0; i != list.size(); ++i) //for (int i = 0; i != list.size(); ++i)
...@@ -1198,9 +1198,9 @@ void GdbEngine::handleStackListArgumentsClassic(const GdbResponse &response) ...@@ -1198,9 +1198,9 @@ void GdbEngine::handleStackListArgumentsClassic(const GdbResponse &response)
// is ok. // is ok.
m_currentFunctionArgs.clear(); m_currentFunctionArgs.clear();
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
const GdbMi list = response.data.findChild("stack-args"); const GdbMi list = response.data["stack-args"];
const GdbMi frame = list.findChild("frame"); const GdbMi frame = list["frame"];
const GdbMi args = frame.findChild("args"); const GdbMi args = frame["args"];
m_currentFunctionArgs = args.children(); m_currentFunctionArgs = args.children();
} else { } else {
// Seems to occur on "RedHat 4 based Linux" gdb 7.0.1: // Seems to occur on "RedHat 4 based Linux" gdb 7.0.1:
...@@ -1215,7 +1215,7 @@ void GdbEngine::handleStackListLocalsClassic(const GdbResponse &response) ...@@ -1215,7 +1215,7 @@ void GdbEngine::handleStackListLocalsClassic(const GdbResponse &response)
// stage 2/2 // stage 2/2
// There could be shadowed variables // There could be shadowed variables
QList<GdbMi> locals = response.data.findChild("locals").children(); QList<GdbMi> locals = response.data["locals"].children();
locals += m_currentFunctionArgs; locals += m_currentFunctionArgs;
QMap<QByteArray, int> seen; QMap<QByteArray, int> seen;
// If desired, retrieve list of uninitialized variables looking at // If desired, retrieve list of uninitialized variables looking at
...@@ -1346,7 +1346,7 @@ void GdbEngine::handleQueryDebuggingHelperClassic(const GdbResponse &response) ...@@ -1346,7 +1346,7 @@ void GdbEngine::handleQueryDebuggingHelperClassic(const GdbResponse &response)
void GdbEngine::handleDebuggingHelperVersionCheckClassic(const GdbResponse &response) void GdbEngine::handleDebuggingHelperVersionCheckClassic(const GdbResponse &response)
{ {
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
QString value = _(response.data.findChild("value").data()); QString value = _(response.data["value"].data());
QString debuggeeQtVersion = value.section(QLatin1Char('"'), 1, 1); QString debuggeeQtVersion = value.section(QLatin1Char('"'), 1, 1);
QString dumperQtVersion = QLatin1String(m_dumperHelper.qtVersionString()); QString dumperQtVersion = QLatin1String(m_dumperHelper.qtVersionString());
if (debuggeeQtVersion.isEmpty()) { if (debuggeeQtVersion.isEmpty()) {
...@@ -1375,8 +1375,8 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item, ...@@ -1375,8 +1375,8 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item,
{ {
//qDebug() << "VAR_LIST_CHILDREN: PARENT" << parent.toString(); //qDebug() << "VAR_LIST_CHILDREN: PARENT" << parent.toString();
//qDebug() << "VAR_LIST_CHILDREN: ITEM" << item.toString(); //qDebug() << "VAR_LIST_CHILDREN: ITEM" << item.toString();
QByteArray exp = item.findChild("exp").data(); QByteArray exp = item["exp"].data();
QByteArray name = item.findChild("name").data(); QByteArray name = item["name"].data();
if (isAccessSpecifier(exp)) { if (isAccessSpecifier(exp)) {
// Suppress 'private'/'protected'/'public' level. // Suppress 'private'/'protected'/'public' level.
WatchData data; WatchData data;
...@@ -1393,15 +1393,15 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item, ...@@ -1393,15 +1393,15 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item,
postCommand(cmd, Discardable, postCommand(cmd, Discardable,
CB(handleVarListChildrenClassic), QVariant::fromValue(data)); CB(handleVarListChildrenClassic), QVariant::fromValue(data));
} else if (!startsWithDigit(QLatin1String(exp)) } else if (!startsWithDigit(QLatin1String(exp))
&& item.findChild("numchild").data() == "0") { && item["numchild"].data() == "0") {
// Happens for structs without data, e.g. interfaces. // Happens for structs without data, e.g. interfaces.
WatchData data; WatchData data;
data.name = _(exp); data.name = _(exp);
data.iname = parent.iname + '.' + data.name.toLatin1(); data.iname = parent.iname + '.' + data.name.toLatin1();
data.variable = name; data.variable = name;
data.updateType(item.findChild("type")); data.updateType(item["type"]);
data.updateValue(item); data.updateValue(item);
data.updateAddress(item.findChild("addr")); data.updateAddress(item["addr"]);
data.setHasChildren(false); data.setHasChildren(false);
insertData(data); insertData(data);
} else if (parent.iname.endsWith('.')) { } else if (parent.iname.endsWith('.')) {
...@@ -1423,10 +1423,10 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item, ...@@ -1423,10 +1423,10 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item,
data.iname = parent.iname + '.' + exp; data.iname = parent.iname + '.' + exp;
data.variable = name; data.variable = name;
data.sortId = sortId; data.sortId = sortId;
data.updateType(item.findChild("type")); data.updateType(item["type"]);
data.updateValue(item); data.updateValue(item);
data.updateAddress(item.findChild("addr")); data.updateAddress(item["addr"]);
data.updateChildCount(item.findChild("numchild")); data.updateChildCount(item["numchild"]);
if (!watchHandler()->isExpandedIName(data.iname)) if (!watchHandler()->isExpandedIName(data.iname))
data.setChildrenUnneeded(); data.setChildrenUnneeded();
...@@ -1481,7 +1481,7 @@ void GdbEngine::handleVarListChildrenClassic(const GdbResponse &response) ...@@ -1481,7 +1481,7 @@ void GdbEngine::handleVarListChildrenClassic(const GdbResponse &response)
return; return;
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
//qDebug() << "VAR_LIST_CHILDREN: PARENT" << data.toString(); //qDebug() << "VAR_LIST_CHILDREN: PARENT" << data.toString();
QList<GdbMi> children = response.data.findChild("children").children(); QList<GdbMi> children = response.data["children"].children();
if (children.isEmpty()) { if (children.isEmpty()) {
// happens e.g. if no debug information is present or // happens e.g. if no debug information is present or
...@@ -1509,7 +1509,7 @@ void GdbEngine::handleVarListChildrenClassic(const GdbResponse &response) ...@@ -1509,7 +1509,7 @@ void GdbEngine::handleVarListChildrenClassic(const GdbResponse &response)
handleVarListChildrenHelperClassic(children.at(i), data, i); handleVarListChildrenHelperClassic(children.at(i), data, i);
} }