Commit 72d19988 authored by hjk's avatar hjk
Browse files

Debugger: Implement "Create Full Backtrace" for LLDB



Task-number: QTCREATORBUG-11642
Change-Id: I92d7cde1e5021ab06ad72a00645184c41dae0e6b
Reviewed-by: default avatarUlf Hermann <ulf.hermann@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent a8e08dc1
......@@ -1562,6 +1562,12 @@ class Dumper(DumperBase):
def requestModuleSymbols(self, frame):
self.handleCommand("target module list " + frame)
def createFullBacktrace(self, _ = None):
command = "thread backtrace all"
result = lldb.SBCommandReturnObject()
self.debugger.GetCommandInterpreter().HandleCommand(command, result)
self.report('full-backtrace="%s"' % self.hexencode(result.GetOutput()))
def executeDebuggerCommand(self, args):
result = lldb.SBCommandReturnObject()
command = args['command']
......
......@@ -108,7 +108,7 @@ LldbEngine::LldbEngine(const DebuggerStartParameters &startParameters)
connect(debuggerCore()->action(AutoDerefPointers), SIGNAL(valueChanged(QVariant)),
SLOT(updateLocals()));
connect(debuggerCore()->action(CreateFullBacktrace), SIGNAL(triggered()),
SLOT(updateAll()));
SLOT(createFullBacktrace()));
connect(debuggerCore()->action(UseDebuggingHelpers), SIGNAL(valueChanged(QVariant)),
SLOT(updateLocals()));
connect(debuggerCore()->action(UseDynamicType), SIGNAL(valueChanged(QVariant)),
......@@ -432,6 +432,8 @@ void LldbEngine::handleResponse(const QByteArray &response)
refreshMemory(item);
else if (name == "continuation")
runContinuation(item);
else if (name == "full-backtrace")
showFullBacktrace(item);
else if (name == "statusmessage") {
QString msg = QString::fromUtf8(item.data());
if (msg.size())
......@@ -441,6 +443,12 @@ void LldbEngine::handleResponse(const QByteArray &response)
}
}
void LldbEngine::showFullBacktrace(const GdbMi &data)
{
debuggerCore()->openTextEditor(_("Backtrace $"),
QString::fromUtf8(QByteArray::fromHex(data.data())));
}
void LldbEngine::runContinuation(const GdbMi &data)
{
const QByteArray target = data.data();
......@@ -1252,6 +1260,10 @@ void LldbEngine::fetchDisassembler(DisassemblerAgent *agent)
runCommand(cmd);
}
void LldbEngine::createFullBacktrace()
{
runCommand("createFullBacktrace");
}
void LldbEngine::fetchMemory(MemoryAgent *agent, QObject *editorToken,
quint64 addr, quint64 length)
......
......@@ -162,6 +162,7 @@ private:
Q_SLOT void runEngine2();
Q_SLOT void updateAll();
Q_SLOT void updateLocals();
Q_SLOT void createFullBacktrace();
void doUpdateLocals(UpdateParameters params);
void refreshAll(const GdbMi &all);
void refreshThreads(const GdbMi &threads);
......@@ -181,6 +182,7 @@ private:
void refreshChangedBreakpoint(const GdbMi &bkpts);
void refreshRemovedBreakpoint(const GdbMi &bkpts);
void runContinuation(const GdbMi &data);
void showFullBacktrace(const GdbMi &data);
typedef void (LldbEngine::*LldbCommandContinuation)();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment