Debugger: Do not raise watchers window unconditionally

In case of mixed debugging it may happen that the trigger
for add an expression happens on a different debugger
engine than the raise of the watchers window as the
companion engine might have been interrupted and the
current perspective has changed accordingly.
Avoid raising the watchers window for the other engine
in that case.

Fixes: QTCREATORBUG-23545
Change-Id: Ic3472b17c727f1336afd1945b5bc448e75e25b4f
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-02-03 10:22:57 +01:00
parent 07e38c5436
commit 32d9af894f

View File

@@ -2288,6 +2288,12 @@ void DebuggerEngine::openDisassemblerView(const Location &location)
void DebuggerEngine::raiseWatchersWindow()
{
if (d->m_watchersView && d->m_watchersWindow) {
auto currentPerspective = DebuggerMainWindow::currentPerspective();
QTC_ASSERT(currentPerspective, return);
// if a companion engine has taken over - do not raise the watchers
if (currentPerspective->name() != d->m_engine->displayName())
return;
if (auto dock = qobject_cast<QDockWidget *>(d->m_watchersWindow->parentWidget())) {
if (QAction *act = dock->toggleViewAction()) {
if (!act->isChecked())