Commit d771ba89 authored by Ulf Hermann's avatar Ulf Hermann

Debugger: Don't clear unrelated views when updating locals

If the list of partial expressions is empty we need to tell the watch
handler that we are only updating the locals view, not e.g. the
inspector view.

Change-Id: Iedc74ffc66a8435faa272d053849b831f6b8cbbe
Task-number: QTCREATORBUG-16692
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
Reviewed-by: default avatarhjk <hjk@qt.io>
parent d8c6b2d4
......@@ -1217,7 +1217,7 @@ void CdbEngine::activateFrame(int index)
void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
{
if (m_pythonVersion > 0x030000) {
watchHandler()->notifyUpdateStarted(updateParameters.partialVariables());
watchHandler()->notifyUpdateStarted(updateParameters);
DebuggerCommand cmd("theDumper.fetchVariables", ScriptCommand);
watchHandler()->appendFormatRequests(&cmd);
......@@ -1270,7 +1270,7 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
return;
}
watchHandler()->notifyUpdateStarted(updateParameters.partialVariables());
watchHandler()->notifyUpdateStarted(updateParameters);
/* Watchers: Forcibly discard old symbol group as switching from
* thread 0/frame 0 -> thread 1/assembly -> thread 0/frame 0 will otherwise re-use it
......
......@@ -2061,7 +2061,7 @@ void DebuggerEngine::updateItem(const QString &iname)
WatchModelBase *model = handler->model();
QTC_CHECK(model);
if (item && !model->hasChildren(model->indexForItem(item))) {
handler->notifyUpdateStarted({iname});
handler->notifyUpdateStarted(UpdateParameters(iname));
item->setValue(decodeData({}, "notaccessible"));
item->setHasChildren(false);
item->outdated = false;
......
......@@ -122,7 +122,8 @@ public:
class UpdateParameters
{
public:
UpdateParameters() {}
UpdateParameters(const QString &partialVariable = QString()) :
partialVariable(partialVariable) {}
QStringList partialVariables() const
{
......
......@@ -4493,7 +4493,7 @@ void GdbEngine::doUpdateLocals(const UpdateParameters &params)
{
m_pendingBreakpointRequests = 0;
watchHandler()->notifyUpdateStarted(params.partialVariables());
watchHandler()->notifyUpdateStarted(params);
DebuggerCommand cmd("fetchVariables", Discardable|InUpdateLocals|PythonCommand);
watchHandler()->appendFormatRequests(&cmd);
......
......@@ -796,7 +796,7 @@ void LldbEngine::assignValueInDebugger(WatchItem *,
void LldbEngine::doUpdateLocals(const UpdateParameters &params)
{
watchHandler()->notifyUpdateStarted(params.partialVariables());
watchHandler()->notifyUpdateStarted(params);
DebuggerCommand cmd("fetchVariables");
watchHandler()->appendFormatRequests(&cmd);
......
......@@ -2156,7 +2156,7 @@ void QmlEnginePrivate::handleFrame(const QVariantMap &response)
StackHandler *stackHandler = engine->stackHandler();
WatchHandler * watchHandler = engine->watchHandler();
watchHandler->notifyUpdateStarted({"local"});
watchHandler->notifyUpdateStarted();
const int frameIndex = stackHandler->currentIndex();
if (frameIndex < 0)
......
......@@ -1999,8 +1999,12 @@ void WatchHandler::resetWatchers()
loadSessionData();
}
void WatchHandler::notifyUpdateStarted(const QStringList &inames)
void WatchHandler::notifyUpdateStarted(const UpdateParameters &updateParameters)
{
QStringList inames = updateParameters.partialVariables();
if (inames.isEmpty())
inames.append("local");
auto marker = [](WatchItem *item) { item->outdated = true; };
if (inames.isEmpty()) {
......
......@@ -26,6 +26,7 @@
#pragma once
#include "watchdata.h"
#include "debuggerengine.h"
#include <QVector>
......@@ -111,7 +112,7 @@ public:
void resetValueCache();
void resetWatchers();
void notifyUpdateStarted(const QStringList &inames = {});
void notifyUpdateStarted(const UpdateParameters &updateParameters = UpdateParameters());
void notifyUpdateFinished();
void reexpandItems();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment