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

@@ -1179,9 +1179,11 @@ class Dumper(DumperBase):
shadowed = {} shadowed = {}
ids = {} # Filter out duplicates entries at the same address. ids = {} # Filter out duplicates entries at the same address.
if isPartial: # FIXME: Implement shortcut for partial updates.
values = [frame.FindVariable(partialVariable)] #if isPartial:
else: # values = [frame.FindVariable(partialVariable)]
#else:
if True:
values = list(frame.GetVariables(True, True, False, False)) values = list(frame.GetVariables(True, True, False, False))
values.reverse() # To get shadowed vars numbered backwards. values.reverse() # To get shadowed vars numbered backwards.

View File

@@ -414,7 +414,7 @@ void CdbEngine::syncVerboseLog(bool verboseLog)
postCommand(m_verboseLog ? QByteArray("!sym noisy") : QByteArray("!sym quiet"), 0); postCommand(m_verboseLog ? QByteArray("!sym noisy") : QByteArray("!sym quiet"), 0);
} }
bool CdbEngine::setToolTipExpression(const DebuggerToolTipContext &context) bool CdbEngine::canHandleToolTip(const DebuggerToolTipContext &context) const
{ {
Q_UNUSED(context); Q_UNUSED(context);
// Tooltips matching local variables are already handled in the // Tooltips matching local variables are already handled in the

View File

@@ -78,7 +78,7 @@ public:
// Factory function that returns 0 if the debug engine library cannot be found. // Factory function that returns 0 if the debug engine library cannot be found.
virtual bool setToolTipExpression(const DebuggerToolTipContext &context); virtual bool canHandleToolTip(const DebuggerToolTipContext &context) const;
virtual DebuggerEngine *cppEngine() { return this; } virtual DebuggerEngine *cppEngine() { return this; }

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

View File

@@ -108,6 +108,14 @@ public:
int testCase; int testCase;
}; };
class UpdateParameters
{
public:
UpdateParameters() {}
QByteArray partialVariable;
};
class Location class Location
{ {
public: public:
@@ -167,10 +175,9 @@ public:
const DebuggerRunParameters &runParameters() const; const DebuggerRunParameters &runParameters() const;
DebuggerRunParameters &runParameters(); DebuggerRunParameters &runParameters();
virtual bool setToolTipExpression(const Internal::DebuggerToolTipContext &); virtual bool canHandleToolTip(const DebuggerToolTipContext &) const;
virtual void updateWatchData(const QByteArray &iname);
virtual void updateWatchItem(WatchItem *) {} virtual void selectWatchData(const QByteArray &iname);
virtual void watchDataSelected(const QByteArray &iname);
virtual void startDebugger(DebuggerRunControl *runControl); virtual void startDebugger(DebuggerRunControl *runControl);
@@ -218,6 +225,7 @@ public:
virtual void createSnapshot(); virtual void createSnapshot();
virtual void updateAll(); virtual void updateAll();
virtual void updateLocals();
virtual bool stateAcceptsBreakpointChanges() const { return true; } virtual bool stateAcceptsBreakpointChanges() const { return true; }
virtual void attemptBreakpointSynchronization(); virtual void attemptBreakpointSynchronization();
@@ -282,7 +290,7 @@ public:
DebuggerEngine *masterEngine() const; DebuggerEngine *masterEngine() const;
virtual DebuggerEngine *cppEngine() { return 0; } virtual DebuggerEngine *cppEngine() { return 0; }
virtual bool canDisplayTooltip() const { return state() == InferiorStopOk; } virtual bool canDisplayTooltip() const;
virtual void notifyInferiorIll(); virtual void notifyInferiorIll();
@@ -377,6 +385,8 @@ protected:
virtual void frameUp(); virtual void frameUp();
virtual void frameDown(); virtual void frameDown();
virtual void doUpdateLocals(const UpdateParameters &params);
void setTargetState(DebuggerState state); void setTargetState(DebuggerState state);
void setMasterEngine(DebuggerEngine *masterEngine); void setMasterEngine(DebuggerEngine *masterEngine);
@@ -431,6 +441,7 @@ DebuggerRunControl *createAndScheduleRun(const DebuggerRunParameters &rp);
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger
Q_DECLARE_METATYPE(Debugger::Internal::UpdateParameters)
Q_DECLARE_METATYPE(Debugger::Internal::ContextData) Q_DECLARE_METATYPE(Debugger::Internal::ContextData)
#endif // DEBUGGER_DEBUGGERENGINE_H #endif // DEBUGGER_DEBUGGERENGINE_H

View File

@@ -1221,8 +1221,9 @@ static void slotTooltipOverrideRequested
tooltip->context.mousePosition = point; tooltip->context.mousePosition = point;
m_tooltips.push_back(tooltip); m_tooltips.push_back(tooltip);
tooltip->setState(PendingUnshown); tooltip->setState(PendingUnshown);
*handled = engine->setToolTipExpression(context); if (engine->canHandleToolTip(context)) {
if (!*handled) { engine->updateWatchData(context.iname);
} else {
ToolTip::show(point, DebuggerToolTipManager::tr("Expression too complex"), ToolTip::show(point, DebuggerToolTipManager::tr("Expression too complex"),
Internal::mainWindow()); Internal::mainWindow());
tooltip->destroy(); tooltip->destroy();

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

View File

@@ -381,7 +381,6 @@ protected:
// //
// Watch specific stuff // Watch specific stuff
// //
virtual bool setToolTipExpression(const DebuggerToolTipContext &);
virtual void assignValueInDebugger(WatchItem *item, virtual void assignValueInDebugger(WatchItem *item,
const QString &expr, const QVariant &value); const QString &expr, const QVariant &value);
@@ -396,7 +395,6 @@ protected:
virtual void watchPoint(const QPoint &); virtual void watchPoint(const QPoint &);
void handleWatchPoint(const DebuggerResponse &response); void handleWatchPoint(const DebuggerResponse &response);
void updateWatchItem(WatchItem *item);
void showToolTip(); void showToolTip();
void handleVarAssign(const DebuggerResponse &response); void handleVarAssign(const DebuggerResponse &response);
@@ -407,9 +405,8 @@ protected:
Q_SLOT void createFullBacktrace(); Q_SLOT void createFullBacktrace();
void handleCreateFullBacktrace(const DebuggerResponse &response); void handleCreateFullBacktrace(const DebuggerResponse &response);
void updateLocals(); void doUpdateLocals(const UpdateParameters &parameters);
void doUpdateLocals(const UpdateParameters &parameters); void handleStackFrame(const DebuggerResponse &response);
void handleStackFramePython(const DebuggerResponse &response);
void setLocals(const QList<GdbMi> &locals); void setLocals(const QList<GdbMi> &locals);

View File

@@ -814,19 +814,9 @@ void LldbEngine::refreshSymbols(const GdbMi &symbols)
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
bool LldbEngine::setToolTipExpression(const DebuggerToolTipContext &context) bool LldbEngine::canHandleToolTip(const DebuggerToolTipContext &context) const
{ {
if (state() != InferiorStopOk || !context.isCppEditor) { return state() == InferiorStopOk && context.isCppEditor;
//qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED "
// " OR NOT A CPPEDITOR";
return false;
}
UpdateParameters params;
params.partialVariable = context.iname;
doUpdateLocals(params);
return true;
} }
void LldbEngine::updateAll() void LldbEngine::updateAll()
@@ -867,19 +857,7 @@ void LldbEngine::assignValueInDebugger(WatchItem *,
runCommand(cmd); runCommand(cmd);
} }
void LldbEngine::updateWatchItem(WatchItem *) void LldbEngine::doUpdateLocals(const UpdateParameters &params)
{
doUpdateLocals(UpdateParameters());
}
void LldbEngine::updateLocals()
{
watchHandler()->resetValueCache();
watchHandler()->notifyUpdateStarted();
doUpdateLocals(UpdateParameters());
}
void LldbEngine::doUpdateLocals(UpdateParameters params)
{ {
if (stackHandler()->stackSize() == 0) { if (stackHandler()->stackSize() == 0) {
showMessage(_("SKIPPING LOCALS DUE TO EMPTY STACK")); showMessage(_("SKIPPING LOCALS DUE TO EMPTY STACK"));

View File

@@ -87,7 +87,7 @@ private:
void shutdownEngine(); void shutdownEngine();
void abortDebugger(); void abortDebugger();
bool setToolTipExpression(const DebuggerToolTipContext &); bool canHandleToolTip(const DebuggerToolTipContext &) const;
void continueInferior(); void continueInferior();
void interruptInferior(); void interruptInferior();
@@ -122,7 +122,6 @@ private:
bool supportsThreads() const { return true; } bool supportsThreads() const { return true; }
bool isSynchronous() const { return true; } bool isSynchronous() const { return true; }
void updateWatchItem(WatchItem *item);
void setRegisterValue(const QByteArray &name, const QString &value); void setRegisterValue(const QByteArray &name, const QString &value);
void fetchMemory(Internal::MemoryAgent *, QObject *, quint64 addr, quint64 length); void fetchMemory(Internal::MemoryAgent *, QObject *, quint64 addr, quint64 length);
@@ -142,9 +141,8 @@ private:
void readLldbStandardError(); void readLldbStandardError();
void handleResponse(const QByteArray &data); void handleResponse(const QByteArray &data);
void updateAll(); void updateAll();
void updateLocals();
void createFullBacktrace(); void createFullBacktrace();
void doUpdateLocals(UpdateParameters params); void doUpdateLocals(const UpdateParameters &params);
void handleContinuation(const GdbMi &data); void handleContinuation(const GdbMi &data);
void refreshAll(const GdbMi &all); void refreshAll(const GdbMi &all);

View File

@@ -378,16 +378,9 @@ void PdbEngine::refreshSymbols(const GdbMi &symbols)
Internal::showModuleSymbols(moduleName, syms); Internal::showModuleSymbols(moduleName, syms);
} }
bool PdbEngine::setToolTipExpression(const DebuggerToolTipContext &ctx) bool PdbEngine::canHandleToolTip(const DebuggerToolTipContext &) const
{ {
if (state() != InferiorStopOk) return state() == InferiorStopOk;
return false;
DebuggerCommand cmd("evaluateTooltip");
ctx.appendFormatRequest(&cmd);
watchHandler()->appendFormatRequests(&cmd);
runCommand(cmd);
return true;
} }
void PdbEngine::assignValueInDebugger(WatchItem *, const QString &expression, const QVariant &value) void PdbEngine::assignValueInDebugger(WatchItem *, const QString &expression, const QVariant &value)
@@ -401,9 +394,9 @@ void PdbEngine::assignValueInDebugger(WatchItem *, const QString &expression, co
updateLocals(); updateLocals();
} }
void PdbEngine::updateWatchItem(WatchItem *item) void PdbEngine::updateWatchData(const QByteArray &iname)
{ {
Q_UNUSED(item); Q_UNUSED(iname);
updateAll(); updateAll();
} }

View File

@@ -66,7 +66,7 @@ private:
void shutdownInferior(); void shutdownInferior();
void shutdownEngine(); void shutdownEngine();
bool setToolTipExpression(const DebuggerToolTipContext &); bool canHandleToolTip(const DebuggerToolTipContext &) const;
void continueInferior(); void continueInferior();
void interruptInferior(); void interruptInferior();
@@ -96,7 +96,7 @@ private:
bool supportsThreads() const { return true; } bool supportsThreads() const { return true; }
bool isSynchronous() const { return true; } bool isSynchronous() const { return true; }
void updateWatchItem(WatchItem *item); void updateWatchData(const QByteArray &iname);
QString mainPythonFile() const; QString mainPythonFile() const;
QString pythonInterpreter() const; QString pythonInterpreter() const;

View File

@@ -102,29 +102,28 @@ bool QmlCppEngine::canDisplayTooltip() const
return m_cppEngine->canDisplayTooltip() || m_qmlEngine->canDisplayTooltip(); return m_cppEngine->canDisplayTooltip() || m_qmlEngine->canDisplayTooltip();
} }
bool QmlCppEngine::setToolTipExpression(const DebuggerToolTipContext &ctx) bool QmlCppEngine::canHandleToolTip(const DebuggerToolTipContext &ctx) const
{ {
bool success = false; bool success = false;
if (ctx.isCppEditor) if (ctx.isCppEditor)
success = m_cppEngine->setToolTipExpression(ctx); success = m_cppEngine->canHandleToolTip(ctx);
else else
success = m_qmlEngine->setToolTipExpression(ctx); success = m_qmlEngine->canHandleToolTip(ctx);
return success; return success;
} }
void QmlCppEngine::updateWatchItem(WatchItem *item) void QmlCppEngine::updateWatchData(const QByteArray &iname)
{ {
if (item->isInspect()) if (iname.startsWith("inspect."))
m_qmlEngine->updateWatchItem(item); m_qmlEngine->updateWatchData(iname);
else else
m_activeEngine->updateWatchItem(item); m_activeEngine->updateWatchData(iname);
} }
void QmlCppEngine::watchDataSelected(const QByteArray &iname) void QmlCppEngine::selectWatchData(const QByteArray &iname)
{ {
const WatchItem *item = watchHandler()->findItem(iname); if (iname.startsWith("inspect."))
if (item && item->isInspect()) m_qmlEngine->selectWatchData(iname);
m_qmlEngine->watchDataSelected(iname);
} }
void QmlCppEngine::watchPoint(const QPoint &point) void QmlCppEngine::watchPoint(const QPoint &point)

View File

@@ -47,9 +47,9 @@ public:
~QmlCppEngine(); ~QmlCppEngine();
bool canDisplayTooltip() const; bool canDisplayTooltip() const;
bool setToolTipExpression(const DebuggerToolTipContext &); bool canHandleToolTip(const DebuggerToolTipContext &) const;
void updateWatchItem(WatchItem *item); void updateWatchData(const QByteArray &iname);
void watchDataSelected(const QByteArray &iname); void selectWatchData(const QByteArray &iname);
void watchPoint(const QPoint &); void watchPoint(const QPoint &);
void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length); void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length);

View File

@@ -973,12 +973,11 @@ void QmlEngine::requestModuleSymbols(const QString &moduleName)
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
bool QmlEngine::setToolTipExpression(const DebuggerToolTipContext &context) bool QmlEngine::canHandleToolTip(const DebuggerToolTipContext &) const
{ {
// This is processed by QML inspector, which has dependencies to // This is processed by QML inspector, which has dependencies to
// the qml js editor. Makes life easier. // the qml js editor. Makes life easier.
// FIXME: Except that there isn't any attached. // FIXME: Except that there isn't any attached.
emit tooltipRequested(context);
return true; return true;
} }
@@ -999,11 +998,12 @@ void QmlEngine::assignValueInDebugger(WatchItem *item,
} }
} }
void QmlEngine::updateWatchItem(WatchItem *item) void QmlEngine::updateWatchData(const QByteArray &iname)
{ {
// qDebug() << "UPDATE WATCH DATA" << data.toString(); // qDebug() << "UPDATE WATCH DATA" << data.toString();
//showStatusMessage(tr("Stopped."), 5000); //showStatusMessage(tr("Stopped."), 5000);
const WatchItem *item = watchHandler()->findItem(iname);
QTC_ASSERT(item, return);
if (item->isInspect()) { if (item->isInspect()) {
m_inspectorAdapter.agent()->updateWatchData(*item); m_inspectorAdapter.agent()->updateWatchData(*item);
} else { } else {
@@ -1018,7 +1018,7 @@ void QmlEngine::updateWatchItem(WatchItem *item)
} }
} }
void QmlEngine::watchDataSelected(const QByteArray &iname) void QmlEngine::selectWatchData(const QByteArray &iname)
{ {
const WatchItem *item = watchHandler()->findItem(iname); const WatchItem *item = watchHandler()->findItem(iname);
if (item && item->isInspect()) if (item && item->isInspect())

View File

@@ -89,9 +89,6 @@ public:
void insertBreakpoint(Breakpoint bp); void insertBreakpoint(Breakpoint bp);
signals:
void tooltipRequested(const DebuggerToolTipContext &context);
private slots: private slots:
void disconnected(); void disconnected();
void documentUpdated(QmlJS::Document::Ptr doc); void documentUpdated(QmlJS::Document::Ptr doc);
@@ -128,7 +125,7 @@ private:
void shutdownInferior(); void shutdownInferior();
void shutdownEngine(); void shutdownEngine();
bool setToolTipExpression(const DebuggerToolTipContext &); bool canHandleToolTip(const DebuggerToolTipContext &) const;
void continueInferior(); void continueInferior();
void interruptInferior(); void interruptInferior();
@@ -157,8 +154,8 @@ private:
void reloadFullStack() {} void reloadFullStack() {}
bool supportsThreads() const { return false; } bool supportsThreads() const { return false; }
void updateWatchItem(WatchItem *item); void updateWatchData(const QByteArray &iname);
void watchDataSelected(const QByteArray &iname); void selectWatchData(const QByteArray &iname);
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages); void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
bool evaluateScript(const QString &expression); bool evaluateScript(const QString &expression);

View File

@@ -683,7 +683,7 @@ void WatchItem::fetchMore()
model->m_fetchTriggered.insert(iname); model->m_fetchTriggered.insert(iname);
if (children().isEmpty()) { if (children().isEmpty()) {
setChildrenNeeded(); setChildrenNeeded();
model->m_engine->updateWatchItem(this); model->m_engine->updateWatchData(iname);
} }
} }
@@ -940,12 +940,12 @@ bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role
case LocalsTypeFormatRole: case LocalsTypeFormatRole:
setTypeFormat(item->type, value.toInt()); setTypeFormat(item->type, value.toInt());
m_engine->updateWatchItem(item); m_engine->updateWatchData(item->iname);
break; break;
case LocalsIndividualFormatRole: { case LocalsIndividualFormatRole: {
setIndividualFormat(item->iname, value.toInt()); setIndividualFormat(item->iname, value.toInt());
m_engine->updateWatchItem(item); m_engine->updateWatchData(item->iname);
break; break;
} }
} }
@@ -1281,7 +1281,7 @@ void WatchHandler::watchExpression(const QString &exp0, const QString &name)
item->setValue(QString(QLatin1Char(' '))); item->setValue(QString(QLatin1Char(' ')));
m_model->insertItem(item); m_model->insertItem(item);
} else { } else {
m_model->m_engine->updateWatchItem(item); m_model->m_engine->updateWatchData(item->iname);
} }
updateWatchersWindow(); updateWatchersWindow();
} }

View File

@@ -125,14 +125,6 @@ private:
void parseWatchData(const GdbMi &input); void parseWatchData(const GdbMi &input);
}; };
class UpdateParameters
{
public:
UpdateParameters() {}
QByteArray partialVariable;
};
class WatchModelBase : public Utils::TreeModel class WatchModelBase : public Utils::TreeModel
{ {
Q_OBJECT Q_OBJECT
@@ -216,7 +208,6 @@ private:
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger
Q_DECLARE_METATYPE(Debugger::Internal::UpdateParameters)
Q_DECLARE_METATYPE(Debugger::Internal::DisplayFormats) Q_DECLARE_METATYPE(Debugger::Internal::DisplayFormats)
#endif // DEBUGGER_WATCHHANDLER_H #endif // DEBUGGER_WATCHHANDLER_H

View File

@@ -961,7 +961,7 @@ void WatchTreeView::setModel(QAbstractItemModel *model)
void WatchTreeView::rowActivated(const QModelIndex &index) void WatchTreeView::rowActivated(const QModelIndex &index)
{ {
currentEngine()->watchDataSelected(index.data(LocalsINameRole).toByteArray()); currentEngine()->selectWatchData(index.data(LocalsINameRole).toByteArray());
} }
void WatchTreeView::handleItemIsExpanded(const QModelIndex &idx) void WatchTreeView::handleItemIsExpanded(const QModelIndex &idx)