diff options
| author | Eike Ziller <[email protected]> | 2013-05-24 16:22:08 +0200 |
|---|---|---|
| committer | Eike Ziller <[email protected]> | 2013-05-24 16:22:08 +0200 |
| commit | 1c34b266fb86a591eb9d7ef406780073e0d6a647 (patch) | |
| tree | 627e7641741b6f2ac0de72932d17a51826f79056 /src/plugins/debugger | |
| parent | e6c822882038f1f7df93ee319b391326fe3b2f02 (diff) | |
| parent | 75aeb5866816e2dccea8b226ed31f0df9cdbfb45 (diff) | |
Merge remote-tracking branch 'origin/2.8'
Diffstat (limited to 'src/plugins/debugger')
| -rw-r--r-- | src/plugins/debugger/debuggerprotocol.h | 2 | ||||
| -rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 35 | ||||
| -rw-r--r-- | src/plugins/debugger/gdb/gdbengine.h | 1 | ||||
| -rw-r--r-- | src/plugins/debugger/lldb/lldbengine.cpp | 69 | ||||
| -rw-r--r-- | src/plugins/debugger/lldb/lldbengine.h | 4 |
5 files changed, 52 insertions, 59 deletions
diff --git a/src/plugins/debugger/debuggerprotocol.h b/src/plugins/debugger/debuggerprotocol.h index cf20a30ad44..dd668e86ad7 100644 --- a/src/plugins/debugger/debuggerprotocol.h +++ b/src/plugins/debugger/debuggerprotocol.h @@ -124,6 +124,8 @@ public: QByteArray toString(bool multiline = false, int indent = 0) const; qulonglong toAddress() const; int toInt() const { return m_data.toInt(); } + QString toUtf8() const { return QString::fromUtf8(m_data); } + QString toLatin1() const { return QString::fromLatin1(m_data); } void fromString(const QByteArray &str); void fromStringMultiple(const QByteArray &str); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 2aa554a92ba..2b8e213d1ce 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -2546,35 +2546,6 @@ QString GdbEngine::breakLocation(const QString &file) const return where; } -BreakpointPathUsage GdbEngine::defaultEngineBreakpointPathUsage() const -{ - // e.g. MinGW gdb 70200 (part of Nokia Qt SDK) - // fails to set breakpoints with absolute paths if - // the source path isn't canonical - if (m_gdbVersion < 70300) - return BreakpointUseShortPath; - // Use short path for file systems with symbolic links. On Windows, main.cpp - // is potentially ambiguous (ANGLE, DLL). - if (startParameters().toolChainAbi.os() != ProjectExplorer::Abi::WindowsOS) - return BreakpointUseShortPath; - - //don't set absolute breakpoints for remote targets - switch (startMode()) { - case AttachToRemoteServer: - case AttachToRemoteProcess: - case LoadRemoteCore: - case StartRemoteProcess: - case StartRemoteGdb: - case StartRemoteEngine: - return BreakpointUseShortPath; - default: - break; - } - - - return BreakpointUseFullPath; -} - QByteArray GdbEngine::breakpointLocation(BreakpointModelId id) { BreakHandler *handler = breakHandler(); @@ -2596,7 +2567,7 @@ QByteArray GdbEngine::breakpointLocation(BreakpointModelId id) BreakpointPathUsage usage = data.pathUsage; if (usage == BreakpointPathUsageEngineDefault) - usage = defaultEngineBreakpointPathUsage(); + usage = BreakpointUseShortPath; const QString fileName = usage == BreakpointUseFullPath ? data.fileName : breakLocation(data.fileName); @@ -2614,7 +2585,7 @@ QByteArray GdbEngine::breakpointLocation2(BreakpointModelId id) BreakpointPathUsage usage = data.pathUsage; if (usage == BreakpointPathUsageEngineDefault) - usage = defaultEngineBreakpointPathUsage(); + usage = BreakpointUseShortPath; const QString fileName = usage == BreakpointUseFullPath ? data.fileName : breakLocation(data.fileName); @@ -3778,7 +3749,7 @@ void GdbEngine::handleThreadInfo(const GdbResponse &response) selectThread(other); } updateViews(); // Adjust Threads combobox. - if (false && m_hasInferiorThreadList && debuggerCore()->boolSetting(ShowThreadNames)) { + if (m_hasInferiorThreadList && debuggerCore()->boolSetting(ShowThreadNames)) { postCommand("threadnames " + debuggerCore()->action(MaximalStackDepth)->value().toByteArray(), Discardable, CB(handleThreadNames)); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 6d50c9f1fd7..1a4d77c580d 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -456,7 +456,6 @@ private: ////////// View & Data Stuff ////////// void handleInfoLine(const GdbResponse &response); void extractDataFromInfoBreak(const QString &output, BreakpointModelId); void updateResponse(BreakpointResponse &response, const GdbMi &bkpt); - BreakpointPathUsage defaultEngineBreakpointPathUsage() const; QByteArray breakpointLocation(BreakpointModelId id); // For gdb/MI. QByteArray breakpointLocation2(BreakpointModelId id); // For gdb/CLI fallback. QString breakLocation(const QString &file) const; diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 71d9aa13898..5786fda6d13 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -427,18 +427,18 @@ void LldbEngine::updateBreakpointData(const GdbMi &bkpt, bool added) const int numChild = locations.children().size(); if (numChild > 1) { foreach (const GdbMi &location, locations.children()) { - const int locid = location["locid"].data().toUShort(); + const int locid = location["locid"].toInt(); BreakpointResponse sub; sub.id = BreakpointResponseId(rid.majorPart(), locid); sub.type = response.type; sub.address = location["addr"].toAddress(); - sub.functionName = QString::fromUtf8(location["func"].data()); + sub.functionName = location["func"].toUtf8(); handler->insertSubBreakpoint(id, sub); } } else if (numChild == 1) { const GdbMi location = locations.childAt(0); response.address = location["addr"].toAddress(); - response.functionName = QString::fromUtf8(location["func"].data()); + response.functionName = location["func"].toUtf8(); } else { QTC_CHECK(false); } @@ -460,11 +460,10 @@ void LldbEngine::refreshDisassembly(const GdbMi &data) if (!agent.isNull()) { foreach (const GdbMi &line, data["lines"].children()) { DisassemblerLine dl; - QByteArray address = line["address"].data(); - dl.address = address.toULongLong(0, 0); - dl.data = _(line["inst"].data()); - dl.function = _(line["func-name"].data()); - dl.offset = line["offset"].data().toUInt(); + dl.address = line["address"].toAddress(); + dl.data = line["inst"].toUtf8(); + dl.function = line["func-name"].toUtf8(); + dl.offset = line["offset"].toInt(); result.appendLine(dl); } agent->setContents(result); @@ -474,7 +473,7 @@ void LldbEngine::refreshDisassembly(const GdbMi &data) void LldbEngine::refreshMemory(const GdbMi &data) { int cookie = data["cookie"].toInt(); - qulonglong addr = data["address"].toInt(); + qulonglong addr = data["address"].toAddress(); QPointer<MemoryAgent> agent = m_memoryAgents.key(cookie); if (!agent.isNull()) { QPointer<QObject> token = m_memoryAgentTokens.value(cookie); @@ -524,8 +523,8 @@ void LldbEngine::refreshModules(const GdbMi &modules) Modules mods; foreach (const GdbMi &item, modules.children()) { Module module; - module.modulePath = QString::fromUtf8(item["file"].data()); - module.moduleName = QString::fromUtf8(item["name"].data()); + module.modulePath = item["file"].toUtf8(); + module.moduleName = item["name"].toUtf8(); module.symbolsRead = Module::UnknownReadState; module.startAddress = item["loaded_addr"].toAddress(); module.endAddress = 0; // FIXME: End address not easily available. @@ -541,15 +540,15 @@ void LldbEngine::requestModuleSymbols(const QString &moduleName) void LldbEngine::refreshSymbols(const GdbMi &symbols) { - QString moduleName = QString::fromUtf8(symbols["module"].data()); + QString moduleName = symbols["module"].toUtf8(); Symbols syms; foreach (const GdbMi &item, symbols["symbols"].children()) { Symbol symbol; - symbol.address = _(item["address"].data()); - symbol.name = _(item["name"].data()); - symbol.state = _(item["state"].data()); - symbol.section = _(item["section"].data()); - symbol.demangled = _(item["demangled"].data()); + symbol.address = item["address"].toUtf8(); + symbol.name = item["name"].toUtf8(); + symbol.state = item["state"].toUtf8(); + symbol.section = item["section"].toUtf8(); + symbol.demangled = item["demangled"].toUtf8(); syms.append(symbol); } debuggerCore()->showModuleSymbols(moduleName, syms); @@ -828,7 +827,7 @@ void LldbEngine::refreshLocals(const GdbMi &vars) dummy.name = decodeData(wname.data(), Base64Encoded8Bit); dummy.exp = dummy.name.toUtf8(); } else { - dummy.name = _(child["name"].data()); + dummy.name = child["name"].toUtf8(); } parseWatchData(handler->expandedINames(), dummy, child, &list); } @@ -844,9 +843,9 @@ void LldbEngine::refreshStack(const GdbMi &stack) foreach (const GdbMi &item, stack["frames"].children()) { StackFrame frame; frame.level = item["level"].toInt(); - frame.file = QString::fromLatin1(item["file"].data()); - frame.function = QString::fromLatin1(item["func"].data()); - frame.from = QString::fromLatin1(item["func"].data()); + frame.file = item["file"].toUtf8(); + frame.function = item["func"].toUtf8(); + frame.from = item["func"].toUtf8(); frame.line = item["line"].toInt(); frame.address = item["addr"].toAddress(); frame.usable = QFileInfo(frame.file).isReadable(); @@ -855,6 +854,9 @@ void LldbEngine::refreshStack(const GdbMi &stack) bool canExpand = stack["hasmore"].toInt(); debuggerCore()->action(ExpandStack)->setEnabled(canExpand); handler->setFrames(frames); + + int index = stack["current-frame"].toInt(); + handler->setCurrentIndex(index); } void LldbEngine::refreshRegisters(const GdbMi ®isters) @@ -929,9 +931,9 @@ void LldbEngine::refreshState(const GdbMi &reportedState) void LldbEngine::refreshLocation(const GdbMi &reportedLocation) { - QByteArray file = reportedLocation["file"].data(); + QString file = reportedLocation["file"].toUtf8(); int line = reportedLocation["line"].toInt(); - gotoLocation(Location(QString::fromUtf8(file), line)); + gotoLocation(Location(file, line)); } void LldbEngine::reloadRegisters() @@ -1035,16 +1037,31 @@ DebuggerEngine *createLldbEngine(const DebuggerStartParameters &startParameters) // /////////////////////////////////////////////////////////////////////// -const LldbEngine::Command &LldbEngine::Command::arg(const char *name, int value) const +const LldbEngine::Command &LldbEngine::Command::argHelper(const char *name, const QByteArray &data) const { args.append('\''); args.append(name); args.append("':"); - args.append(QByteArray::number(value)); - args.append(','); + args.append(data); + args.append(","); return *this; } +const LldbEngine::Command &LldbEngine::Command::arg(const char *name, int value) const +{ + return argHelper(name, QByteArray::number(value)); +} + +const LldbEngine::Command &LldbEngine::Command::arg(const char *name, qlonglong value) const +{ + return argHelper(name, QByteArray::number(value)); +} + +const LldbEngine::Command &LldbEngine::Command::arg(const char *name, qulonglong value) const +{ + return argHelper(name, QByteArray::number(value)); +} + const LldbEngine::Command &LldbEngine::Command::arg(const char *name, const QString &value) const { return arg(name, value.toUtf8().data()); diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h index e8a080f5967..71ff6681790 100644 --- a/src/plugins/debugger/lldb/lldbengine.h +++ b/src/plugins/debugger/lldb/lldbengine.h @@ -68,6 +68,8 @@ private: Command(const char *f) : function(f) {} const Command &arg(const char *name, int value) const; + const Command &arg(const char *name, qlonglong value) const; + const Command &arg(const char *name, qulonglong value) const; const Command &arg(const char *name, const QString &value) const; const Command &arg(const char *name, const QByteArray &value) const; const Command &arg(const char *name, const char *value) const; @@ -78,6 +80,8 @@ private: QByteArray function; mutable QByteArray args; + private: + const Command &argHelper(const char *name, const QByteArray &value) const; }; // DebuggerEngine implementation |
