diff options
Diffstat (limited to 'src/plugins/debugger/cdb/cdbengine.cpp')
-rw-r--r-- | src/plugins/debugger/cdb/cdbengine.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index e57b0b189e..ec8e6b764a 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -339,7 +339,6 @@ void addCdbOptionPages(QList<Core::IOptionsPage *> *opts) CdbEngine::CdbEngine(const DebuggerStartParameters &sp) : DebuggerEngine(sp), - m_creatorExtPrefix("<qtcreatorcdbext>|"), m_tokenPrefix("<token>"), m_effectiveStartMode(NoStartMode), m_accessible(false), @@ -365,6 +364,8 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp) : this, SLOT(operateByInstructionTriggered(bool))); connect(debuggerCore()->action(VerboseLog), SIGNAL(triggered(bool)), this, SLOT(verboseLogTriggered(bool))); + connect(debuggerCore()->action(CreateFullBacktrace), SIGNAL(triggered()), + this, SLOT(createFullBacktrace())); setObjectName(QLatin1String("CdbEngine")); connect(&m_process, SIGNAL(finished(int)), this, SLOT(processFinished())); connect(&m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError())); @@ -597,6 +598,16 @@ void CdbEngine::consoleStubExited() { } +void CdbEngine::createFullBacktrace() +{ + postBuiltinCommand("~*kp", 0, &CdbEngine::handleCreateFullBackTrace); +} + +void CdbEngine::handleCreateFullBackTrace(const CdbEngine::CdbBuiltinCommandPtr &cmd) +{ + debuggerCore()->openTextEditor(QLatin1String("Backtrace $"), QLatin1String(cmd->joinedReply())); +} + void CdbEngine::setupEngine() { if (debug) @@ -1101,6 +1112,7 @@ bool CdbEngine::hasCapability(unsigned cap) const |BreakOnThrowAndCatchCapability // Sort-of: Can break on throw(). |BreakConditionCapability|TracePointCapability |BreakModuleCapability + |CreateFullBacktraceCapability |OperateByInstructionCapability |RunToLineCapability |MemoryAddressCapability); @@ -2541,11 +2553,12 @@ void CdbEngine::parseOutputLine(QByteArray line) while (isCdbPrompt(line)) line.remove(0, CdbPromptLength); // An extension notification (potentially consisting of several chunks) - if (line.startsWith(m_creatorExtPrefix)) { + static const QByteArray creatorExtPrefix = "<qtcreatorcdbext>|"; + if (line.startsWith(creatorExtPrefix)) { // "<qtcreatorcdbext>|type_char|token|remainingChunks|serviceName|message" - const char type = line.at(m_creatorExtPrefix.size()); + const char type = line.at(creatorExtPrefix.size()); // integer token - const int tokenPos = m_creatorExtPrefix.size() + 2; + const int tokenPos = creatorExtPrefix.size() + 2; const int tokenEndPos = line.indexOf('|', tokenPos); QTC_ASSERT(tokenEndPos != -1, return); const int token = line.mid(tokenPos, tokenEndPos - tokenPos).toInt(); |