Debugger: Consolidate GDB and LLDB "updateLocals" code paths

This splits the bool setToolTipExpression() operation into
a bool canHandleToolTip(), and the actual processing of
the request, which is mostly identical to the handling of
a watcher.

Handling a watcher is now mostly the same as a full Locals
update, except for the 'partial' flag. Pushing the handling
of that down to the bridges gives identical code paths
in the gdb and lldbengine. Move that to the
DebuggerEngine base class.

Change-Id: I3861b43e8630c7e7bd57fcd549b2a2387e3d4869
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-06-08 18:07:11 +02:00
parent 7d257acb4b
commit 5309e217e4
19 changed files with 104 additions and 146 deletions

View File

@@ -3693,24 +3693,6 @@ void GdbEngine::handleRegisterListValues(const DebuggerResponse &response)
}
//////////////////////////////////////////////////////////////////////
//
// Tooltip specific stuff
//
//////////////////////////////////////////////////////////////////////
bool GdbEngine::setToolTipExpression(const DebuggerToolTipContext &context)
{
if (state() != InferiorStopOk || !context.isCppEditor)
return false;
UpdateParameters params;
params.partialVariable = context.iname;
doUpdateLocals(params);
return true;
}
//////////////////////////////////////////////////////////////////////
//
// Watch specific stuff
@@ -3723,13 +3705,6 @@ void GdbEngine::reloadLocals()
updateLocals();
}
void GdbEngine::updateWatchItem(WatchItem *item)
{
UpdateParameters params;
params.partialVariable = item->iname;
doUpdateLocals(params);
}
void GdbEngine::handleVarAssign(const DebuggerResponse &)
{
// Everything might have changed, force re-evaluation.
@@ -3737,13 +3712,6 @@ void GdbEngine::handleVarAssign(const DebuggerResponse &)
updateLocals();
}
void GdbEngine::updateLocals()
{
watchHandler()->resetValueCache();
watchHandler()->notifyUpdateStarted();
doUpdateLocals(UpdateParameters());
}
void GdbEngine::assignValueInDebugger(WatchItem *item,
const QString &expression, const QVariant &value)
{
@@ -4744,14 +4712,14 @@ void GdbEngine::doUpdateLocals(const UpdateParameters &params)
cmd.arg("resultvarname", m_resultVarName);
cmd.arg("partialVariable", params.partialVariable);
cmd.flags = Discardable;
cmd.callback = [this, params](const DebuggerResponse &r) { handleStackFramePython(r); };
cmd.callback = [this, params](const DebuggerResponse &r) { handleStackFrame(r); };
runCommand(cmd);
cmd.arg("passExceptions", true);
m_lastDebuggableCommand = cmd;
}
void GdbEngine::handleStackFramePython(const DebuggerResponse &response)
void GdbEngine::handleStackFrame(const DebuggerResponse &response)
{
watchHandler()->notifyUpdateFinished();
if (response.resultClass == ResultDone) {