Debugger: Force LLDB round trip between stack and locals update

The stack might produce data (such as as the QML context in
native mixed debugging) that is needed for locals display.
While this doesn't work yet with LLDB anyway, the change
suppresses one soft access when accessing the top frame of
an empty stack (the usual case on the first update).

Change-Id: If931fbe940b8cda01cc6cc34429a2fcb33cd8d19
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-02-24 11:33:25 +01:00
parent 37bd3eab24
commit 2ee4363d1d
3 changed files with 33 additions and 20 deletions

View File

@@ -871,6 +871,11 @@ class Dumper(DumperBase):
result += ',limit="%d"' % limit
result += '}'
self.report(result)
self.reportContinuation(args)
def reportContinuation(self, args):
if "continuation" in args:
self.report('continuation=\"%s\"' % args["continuation"])
def reportStackPosition(self):
thread = self.currentThread()

View File

@@ -460,6 +460,8 @@ void LldbEngine::handleResponse(const QByteArray &response)
refreshMemory(item);
else if (name == "full-backtrace")
showFullBacktrace(item);
else if (name == "continuation")
handleContinuation(item);
else if (name == "statusmessage") {
QString msg = QString::fromUtf8(item.data());
if (msg.size())
@@ -469,6 +471,15 @@ void LldbEngine::handleResponse(const QByteArray &response)
}
}
void LldbEngine::handleContinuation(const GdbMi &data)
{
if (data.data() == "updateLocals") {
updateLocals();
return;
}
QTC_ASSERT(false, qDebug() << "Unknown continuation: " << data.data());
}
void LldbEngine::showFullBacktrace(const GdbMi &data)
{
Internal::openTextEditor(_("Backtrace $"),
@@ -524,10 +535,10 @@ void LldbEngine::activateFrame(int frameIndex)
DebuggerCommand cmd("activateFrame");
cmd.arg("index", frameIndex);
cmd.arg("thread", threadsHandler()->currentThread().raw());
cmd.arg("continuation", "updateLocals");
runCommand(cmd);
reloadRegisters();
updateLocals();
}
void LldbEngine::selectThread(ThreadId threadId)
@@ -793,8 +804,12 @@ bool LldbEngine::setToolTipExpression(TextEditor::TextEditorWidget *editorWidget
void LldbEngine::updateAll()
{
reloadRegisters();
updateStack();
updateLocals();
DebuggerCommand cmd("reportStack");
cmd.arg("nativeMixed", isNativeMixedActive());
cmd.arg("stacklimit", action(MaximalStackDepth)->value().toInt());
cmd.arg("continuation", "updateLocals");
runCommand(cmd);
}
void LldbEngine::reloadFullStack()
@@ -805,14 +820,6 @@ void LldbEngine::reloadFullStack()
runCommand(cmd);
}
void LldbEngine::updateStack()
{
DebuggerCommand cmd("reportStack");
cmd.arg("nativeMixed", isNativeMixedActive());
cmd.arg("stacklimit", action(MaximalStackDepth)->value().toInt());
runCommand(cmd);
}
//////////////////////////////////////////////////////////////////////
//
// Watch specific stuff

View File

@@ -132,16 +132,17 @@ private:
QString errorMessage(QProcess::ProcessError error) const;
bool hasCapability(unsigned cap) const;
Q_SLOT void handleLldbFinished(int, QProcess::ExitStatus status);
Q_SLOT void handleLldbError(QProcess::ProcessError error);
Q_SLOT void readLldbStandardOutput();
Q_SLOT void readLldbStandardError();
Q_SLOT void handleResponse(const QByteArray &data);
Q_SLOT void updateAll();
Q_SLOT void updateStack();
Q_SLOT void updateLocals();
Q_SLOT void createFullBacktrace();
void handleLldbFinished(int, QProcess::ExitStatus status);
void handleLldbError(QProcess::ProcessError error);
void readLldbStandardOutput();
void readLldbStandardError();
void handleResponse(const QByteArray &data);
void updateAll();
void updateLocals();
void createFullBacktrace();
void doUpdateLocals(UpdateParameters params);
void handleContinuation(const GdbMi &data);
void refreshAll(const GdbMi &all);
void refreshThreads(const GdbMi &threads);
void refreshStack(const GdbMi &stack);