forked from qt-creator/qt-creator
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 <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1217,7 +1217,7 @@ void CdbEngine::activateFrame(int index)
|
|||||||
void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
|
void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
|
||||||
{
|
{
|
||||||
if (m_pythonVersion > 0x030000) {
|
if (m_pythonVersion > 0x030000) {
|
||||||
watchHandler()->notifyUpdateStarted(updateParameters.partialVariables());
|
watchHandler()->notifyUpdateStarted(updateParameters);
|
||||||
|
|
||||||
DebuggerCommand cmd("theDumper.fetchVariables", ScriptCommand);
|
DebuggerCommand cmd("theDumper.fetchVariables", ScriptCommand);
|
||||||
watchHandler()->appendFormatRequests(&cmd);
|
watchHandler()->appendFormatRequests(&cmd);
|
||||||
@@ -1270,7 +1270,7 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
watchHandler()->notifyUpdateStarted(updateParameters.partialVariables());
|
watchHandler()->notifyUpdateStarted(updateParameters);
|
||||||
|
|
||||||
/* Watchers: Forcibly discard old symbol group as switching from
|
/* 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
|
* 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();
|
WatchModelBase *model = handler->model();
|
||||||
QTC_CHECK(model);
|
QTC_CHECK(model);
|
||||||
if (item && !model->hasChildren(model->indexForItem(item))) {
|
if (item && !model->hasChildren(model->indexForItem(item))) {
|
||||||
handler->notifyUpdateStarted({iname});
|
handler->notifyUpdateStarted(UpdateParameters(iname));
|
||||||
item->setValue(decodeData({}, "notaccessible"));
|
item->setValue(decodeData({}, "notaccessible"));
|
||||||
item->setHasChildren(false);
|
item->setHasChildren(false);
|
||||||
item->outdated = false;
|
item->outdated = false;
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ public:
|
|||||||
class UpdateParameters
|
class UpdateParameters
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UpdateParameters() {}
|
UpdateParameters(const QString &partialVariable = QString()) :
|
||||||
|
partialVariable(partialVariable) {}
|
||||||
|
|
||||||
QStringList partialVariables() const
|
QStringList partialVariables() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4493,7 +4493,7 @@ void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
|||||||
{
|
{
|
||||||
m_pendingBreakpointRequests = 0;
|
m_pendingBreakpointRequests = 0;
|
||||||
|
|
||||||
watchHandler()->notifyUpdateStarted(params.partialVariables());
|
watchHandler()->notifyUpdateStarted(params);
|
||||||
|
|
||||||
DebuggerCommand cmd("fetchVariables", Discardable|InUpdateLocals|PythonCommand);
|
DebuggerCommand cmd("fetchVariables", Discardable|InUpdateLocals|PythonCommand);
|
||||||
watchHandler()->appendFormatRequests(&cmd);
|
watchHandler()->appendFormatRequests(&cmd);
|
||||||
|
|||||||
@@ -796,7 +796,7 @@ void LldbEngine::assignValueInDebugger(WatchItem *,
|
|||||||
|
|
||||||
void LldbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
void LldbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
||||||
{
|
{
|
||||||
watchHandler()->notifyUpdateStarted(params.partialVariables());
|
watchHandler()->notifyUpdateStarted(params);
|
||||||
|
|
||||||
DebuggerCommand cmd("fetchVariables");
|
DebuggerCommand cmd("fetchVariables");
|
||||||
watchHandler()->appendFormatRequests(&cmd);
|
watchHandler()->appendFormatRequests(&cmd);
|
||||||
|
|||||||
@@ -2156,7 +2156,7 @@ void QmlEnginePrivate::handleFrame(const QVariantMap &response)
|
|||||||
|
|
||||||
StackHandler *stackHandler = engine->stackHandler();
|
StackHandler *stackHandler = engine->stackHandler();
|
||||||
WatchHandler * watchHandler = engine->watchHandler();
|
WatchHandler * watchHandler = engine->watchHandler();
|
||||||
watchHandler->notifyUpdateStarted({"local"});
|
watchHandler->notifyUpdateStarted();
|
||||||
|
|
||||||
const int frameIndex = stackHandler->currentIndex();
|
const int frameIndex = stackHandler->currentIndex();
|
||||||
if (frameIndex < 0)
|
if (frameIndex < 0)
|
||||||
|
|||||||
@@ -1999,8 +1999,12 @@ void WatchHandler::resetWatchers()
|
|||||||
loadSessionData();
|
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; };
|
auto marker = [](WatchItem *item) { item->outdated = true; };
|
||||||
|
|
||||||
if (inames.isEmpty()) {
|
if (inames.isEmpty()) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "watchdata.h"
|
#include "watchdata.h"
|
||||||
|
#include "debuggerengine.h"
|
||||||
|
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
@@ -111,7 +112,7 @@ public:
|
|||||||
void resetValueCache();
|
void resetValueCache();
|
||||||
void resetWatchers();
|
void resetWatchers();
|
||||||
|
|
||||||
void notifyUpdateStarted(const QStringList &inames = {});
|
void notifyUpdateStarted(const UpdateParameters &updateParameters = UpdateParameters());
|
||||||
void notifyUpdateFinished();
|
void notifyUpdateFinished();
|
||||||
|
|
||||||
void reexpandItems();
|
void reexpandItems();
|
||||||
|
|||||||
Reference in New Issue
Block a user