diff options
| author | hjk <hjk121@nokiamail.com> | 2013-05-03 18:26:10 +0200 |
|---|---|---|
| committer | David Schulz <david.schulz@digia.com> | 2013-05-06 14:41:08 +0200 |
| commit | 9b8b8ba97b02241c0ff1e545232badb0fcee294a (patch) | |
| tree | af7b2d8f219d7d29708db5c64d5657a491d4a467 /src/plugins/debugger/cdb/cdbengine.cpp | |
| parent | 7ac0cb6247b11fe835f2bd2b7870226686ddf291 (diff) | |
| download | qt-creator-9b8b8ba97b02241c0ff1e545232badb0fcee294a.tar.gz | |
Debugger: Replace GdbMi::findChild() with an operator[]
Less noise.
Change-Id: I8e533c97207ff5b9c79182c4fb99993f1992154f
Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'src/plugins/debugger/cdb/cdbengine.cpp')
| -rw-r--r-- | src/plugins/debugger/cdb/cdbengine.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 6dcf854bb3..9adc678c50 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -1821,14 +1821,14 @@ void CdbEngine::handlePid(const CdbExtensionCommandPtr &reply) static Register parseRegister(const GdbMi &gdbmiReg) { Register reg; - reg.name = gdbmiReg.findChild("name").data(); - const GdbMi description = gdbmiReg.findChild("description"); + reg.name = gdbmiReg["name"].data(); + const GdbMi description = gdbmiReg["description"]; if (description.type() != GdbMi::Invalid) { reg.name += " ("; reg.name += description.data(); reg.name += ')'; } - reg.value = gdbmiReg.findChild("value").data(); + reg.value = gdbmiReg["value"].data(); return reg; } @@ -1842,11 +1842,11 @@ void CdbEngine::handleModules(const CdbExtensionCommandPtr &reply) modules.reserve(value.childCount()); foreach (const GdbMi &gdbmiModule, value.children()) { Module module; - module.moduleName = QString::fromLatin1(gdbmiModule.findChild("name").data()); - module.modulePath = QString::fromLatin1(gdbmiModule.findChild("image").data()); - module.startAddress = gdbmiModule.findChild("start").data().toULongLong(0, 0); - module.endAddress = gdbmiModule.findChild("end").data().toULongLong(0, 0); - if (gdbmiModule.findChild("deferred").type() == GdbMi::Invalid) + module.moduleName = QString::fromLatin1(gdbmiModule["name"].data()); + module.modulePath = QString::fromLatin1(gdbmiModule["image"].data()); + module.startAddress = gdbmiModule["start"].data().toULongLong(0, 0); + module.endAddress = gdbmiModule["end"].data().toULongLong(0, 0); + if (gdbmiModule["deferred"].type() == GdbMi::Invalid) module.symbolsRead = Module::ReadOk; modules.push_back(module); } @@ -1902,8 +1902,8 @@ void CdbEngine::handleLocals(const CdbExtensionCommandPtr &reply) // Courtesy of GDB engine foreach (const GdbMi &child, root.children()) { WatchData dummy; - dummy.iname = child.findChild("iname").data(); - dummy.name = QLatin1String(child.findChild("name").data()); + dummy.iname = child["iname"].data(); + dummy.name = QLatin1String(child["name"].data()); parseWatchData(watchHandler()->expandedINames(), dummy, child, &watchData); } // Fix the names of watch data. @@ -2023,7 +2023,7 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason, rc |= StopShutdownInProgress; if (debug) qDebug("%s", stopReason.toString(true, 4).constData()); - const QByteArray reason = stopReason.findChild("reason").data(); + const QByteArray reason = stopReason["reason"].data(); if (reason.isEmpty()) { *message = tr("Malformed stop response received."); rc |= StopReportParseError|StopNotifyStop; @@ -2036,12 +2036,12 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason, rc |= StopReportLog; return rc; } - const int threadId = stopReason.findChild("threadId").data().toInt(); + const int threadId = stopReason["threadId"].data().toInt(); if (reason == "breakpoint") { // Note: Internal breakpoints (run to line) are reported with id=0. // Step out creates temporary breakpoints with id 10000. int number = 0; - BreakpointModelId id = cdbIdToBreakpointModelId(stopReason.findChild("breakpointId")); + BreakpointModelId id = cdbIdToBreakpointModelId(stopReason["breakpointId"]); if (id.isValid()) { if (breakHandler()->engineBreakpointIds(this).contains(id)) { const BreakpointResponse parameters = breakHandler()->response(id); @@ -2211,7 +2211,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT // Re-fetch stack again. postCommandSequence(CommandListStack); } else { - const GdbMi stack = stopReason.findChild("stack"); + const GdbMi stack = stopReason["stack"]; if (stack.isValid()) { switch (parseStackTrace(stack, sourceStepInto)) { case ParseStackStepInto: // Hit on a frame while step into, see parseStackTrace(). @@ -2222,16 +2222,16 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT return; } } 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()) { threadsHandler()->updateThreads(threads); if (forcedThreadId.isValid()) threadsHandler()->setCurrentThread(forcedThreadId); } else { - showMessage(QString::fromLatin1(stopReason.findChild("threaderror").data()), LogError); + showMessage(QString::fromLatin1(stopReason["threaderror"].data()), LogError); } // Fire off remaining commands asynchronously if (!m_pendingBreakpointMap.isEmpty()) @@ -2839,15 +2839,15 @@ static StackFrames parseFrames(const GdbMi &gdbmi, bool *incomplete = 0) } StackFrame frame; frame.level = i; - const GdbMi fullName = frameMi.findChild("fullname"); + const GdbMi fullName = frameMi["fullname"]; if (fullName.isValid()) { 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.function = QLatin1String(frameMi.findChild("func").data()); - frame.from = QLatin1String(frameMi.findChild("from").data()); - frame.address = frameMi.findChild("addr").data().toULongLong(0, 16); + frame.function = QLatin1String(frameMi["func"].data()); + frame.from = QLatin1String(frameMi["from"].data()); + frame.address = frameMi["addr"].data().toULongLong(0, 16); rc.push_back(frame); } return rc; |
