forked from qt-creator/qt-creator
Debugger[CDB]: Do not evaluate watch expressions at all.
setError() on them instead (should there be any from a session mixup). Give the session engine watcher capabilities and ensure 'Remove watch item' is enabled for the session engine by checking the debugger state. Reviewed-by: hjk
This commit is contained in:
@@ -296,6 +296,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
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"));
|
||||
@@ -352,10 +353,12 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user