Commit 4dfb56bb authored by hjk's avatar hjk
Browse files

Debugger: Directly tell memory agents about finishing



Change-Id: I79a718f45835a709daa37dd785ed718c3743d77e
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent 54430ae1
......@@ -1265,6 +1265,7 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
foreach (Breakpoint bp, breakHandler()->engineBreakpoints(this))
bp.notifyBreakpointReleased();
DebuggerToolTipManager::deregisterEngine(this);
d->m_memoryAgent.handleDebuggerFinished();
}
showMessage(msg, LogDebug);
......
......@@ -88,8 +88,6 @@ MemoryAgent::MemoryAgent(DebuggerEngine *engine)
: QObject(engine), m_engine(engine)
{
QTC_CHECK(engine);
connect(engine, &DebuggerEngine::stateChanged,
this, &MemoryAgent::engineStateChanged);
connect(engine, &DebuggerEngine::stackFrameCompleted,
this, &MemoryAgent::updateContents);
}
......@@ -254,19 +252,13 @@ bool MemoryAgent::hasVisibleEditor() const
return false;
}
void MemoryAgent::engineStateChanged(Debugger::DebuggerState s)
void MemoryAgent::handleDebuggerFinished()
{
switch (s) {
case DebuggerFinished:
closeViews();
foreach (const QPointer<IEditor> &editor, m_editors)
if (editor) { // Prevent triggering updates, etc.
MemoryView::setBinEditorReadOnly(editor->widget(), true);
editor->widget()->disconnect(this);
}
break;
default:
break;
foreach (const QPointer<IEditor> &editor, m_editors) {
if (editor) { // Prevent triggering updates, etc.
MemoryView::setBinEditorReadOnly(editor->widget(), true);
editor->widget()->disconnect(this);
}
}
}
......
......@@ -101,6 +101,7 @@ public slots:
void updateContents();
void closeEditors();
void closeViews();
void handleDebuggerFinished();
private slots:
void fetchLazyData(quint64 block);
......@@ -108,7 +109,6 @@ private slots:
void handleDataChanged(quint64 address, const QByteArray &data);
void handleWatchpointRequest(quint64 address, uint size);
void updateMemoryView(quint64 address, quint64 length);
void engineStateChanged(Debugger::DebuggerState s);
private:
void connectBinEditorWidget(QWidget *w);
......
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