if (incomplete.iname.startsWith("watch.")) {
WatchData watchData = incomplete;
- evaluateWatcher(&watchData);
+ watchData.setError(tr("<not supported>"));
watchHandler()->insertData(watchData);
return;
}
#include "sessionengine.h"
#include "breakhandler.h"
#include "watchhandler.h"
+#include "debuggerconstants.h"
#include <utils/qtcassert.h>
breakHandler()->saveSessionData();
}
+unsigned SessionEngine::debuggerCapabilities() const
+{
+ return DebuggerEngine::debuggerCapabilities()
+ | AddWatcherCapability | WatchpointCapability;
+}
+
} // namespace Internal
} // namespace Debugger
virtual void shutdownEngine() {}
virtual void shutdownInferior() {}
virtual void executeDebuggerCommand(const QString &command);
+ virtual unsigned debuggerCapabilities() const;
virtual bool isSessionEngine() const { return true; }
case EngineActionsEnabledRole:
return engine()->debuggerActionsEnabled();
+
+ case EngineStateRole:
+ return QVariant(int(engine()->state()));
}
const WatchItem *item = watchItem(idx);
const unsigned engineCapabilities = modelData(EngineCapabilitiesRole).toUInt();
const bool canHandleWatches =
actionsEnabled && (engineCapabilities & AddWatcherCapability);
+ const DebuggerState state = static_cast<DebuggerState>(modelData(EngineStateRole).toInt());
QMenu menu;
QAction *actInsertNewWatchItem = menu.addAction(tr("Insert New Watch Item"));
QAction *actWatchExpression = new QAction(actionName, &menu);
actWatchExpression->setEnabled(canHandleWatches && !exp.isEmpty());
+ // Can remove watch if engine can handle it or session engine.
actionName = exp.isEmpty() ? tr("Remove Watch Expression")
: tr("Remove Watch Expression \"%1\"").arg(exp);
QAction *actRemoveWatchExpression = new QAction(actionName, &menu);
- actRemoveWatchExpression->setEnabled(canHandleWatches && !exp.isEmpty());
+ actRemoveWatchExpression->setEnabled((canHandleWatches || state == DebuggerNotReady)
+ && !exp.isEmpty());
if (m_type == LocalsType)
menu.addAction(actWatchExpression);