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

@@ -98,6 +98,17 @@ enum { debug = 0 };
//
///////////////////////////////////////////////////////////////////////
DebuggerRunParameters::DebuggerRunParameters()
: cppEngineType(NoEngineType),
isSnapshot(false),
testCase(0)
{}
void DebuggerRunParameters::initialize(const DebuggerStartParameters &sp)
{
DebuggerStartParameters::operator=(sp);
}
// VariableManager Prefix
const char PrefixDebugExecutable[] = "DebuggedExecutable";
@@ -402,6 +413,10 @@ void DebuggerEngine::frameDown()
activateFrame(qMax(currentIndex - 1, 0));
}
void DebuggerEngine::doUpdateLocals(const UpdateParameters &)
{
}
void DebuggerEngine::setTargetState(DebuggerState state)
{
d->m_targetState = state;
@@ -1308,6 +1323,11 @@ DebuggerEngine *DebuggerEngine::masterEngine() const
return d->m_masterEngine;
}
bool DebuggerEngine::canDisplayTooltip() const
{
return state() == InferiorStopOk;
}
QString DebuggerEngine::toFileInProject(const QUrl &fileUrl)
{
// make sure file finder is properly initialized
@@ -1449,12 +1469,7 @@ Terminal *DebuggerEngine::terminal() const
return &d->m_terminal;
}
bool DebuggerEngine::setToolTipExpression(const DebuggerToolTipContext &)
{
return false;
}
void DebuggerEngine::watchDataSelected(const QByteArray &)
void DebuggerEngine::selectWatchData(const QByteArray &)
{
}
@@ -1541,6 +1556,13 @@ void DebuggerEngine::createSnapshot()
{
}
void DebuggerEngine::updateLocals()
{
watchHandler()->resetValueCache();
watchHandler()->notifyUpdateStarted();
doUpdateLocals(UpdateParameters());
}
void DebuggerEngine::updateAll()
{
}
@@ -1983,15 +2005,16 @@ void DebuggerEngine::updateLocalsView(const GdbMi &all)
emit stackFrameCompleted();
}
DebuggerRunParameters::DebuggerRunParameters()
: cppEngineType(NoEngineType),
isSnapshot(false),
testCase(0)
{}
void DebuggerRunParameters::initialize(const DebuggerStartParameters &sp)
bool DebuggerEngine::canHandleToolTip(const DebuggerToolTipContext &context) const
{
DebuggerStartParameters::operator=(sp);
return state() == InferiorStopOk && context.isCppEditor;
}
void DebuggerEngine::updateWatchData(const QByteArray &iname)
{
UpdateParameters params;
params.partialVariable = iname;
doUpdateLocals(params);
}
} // namespace Internal