debugger: prepare removal of plugin()->updateState(this);

This commit is contained in:
hjk
2010-10-27 14:21:33 +02:00
parent fdc35465ed
commit ab967902d8
3 changed files with 20 additions and 8 deletions

View File

@@ -1487,11 +1487,17 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
threadsHandler()->notifyRunning(); threadsHandler()->notifyRunning();
showMessage(msg, LogDebug); showMessage(msg, LogDebug);
plugin()->updateState(this); updateViews();
emit stateChanged(d->m_state); emit stateChanged(d->m_state);
} }
void DebuggerEngine::updateViews()
{
// FIXME: This should not be done for slave engines.
plugin()->updateState(this);
}
void DebuggerEngine::setRunInWrapperEngine(bool value) void DebuggerEngine::setRunInWrapperEngine(bool value)
{ {
d->m_runInWrapperEngine = value; d->m_runInWrapperEngine = value;

View File

@@ -152,7 +152,7 @@ public:
void initializeFromTemplate(DebuggerEngine *other); void initializeFromTemplate(DebuggerEngine *other);
virtual void updateWatchData(const Internal::WatchData &data, virtual void updateWatchData(const Internal::WatchData &data,
const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags()); const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags());
void startDebugger(DebuggerRunControl *runControl); void startDebugger(DebuggerRunControl *runControl);
virtual bool isSessionEngine() const; virtual bool isSessionEngine() const;
@@ -286,8 +286,11 @@ public:
virtual void gotoLocation(const Internal::StackFrame &frame, bool setMarker); virtual void gotoLocation(const Internal::StackFrame &frame, bool setMarker);
virtual void quitDebugger(); // called by DebuggerRunControl virtual void quitDebugger(); // called by DebuggerRunControl
virtual void updateViews();
signals: signals:
void stateChanged(const DebuggerState &state); void stateChanged(const DebuggerState &state);
void updateViewsRequested();
protected: protected:
// The base notify*() function implementation should be sufficient // The base notify*() function implementation should be sufficient

View File

@@ -2994,9 +2994,12 @@ void GdbEngine::handleThreadInfo(const GdbResponse &response)
const int currentThreadId = const int currentThreadId =
response.data.findChild("current-thread-id").data().toInt(); response.data.findChild("current-thread-id").data().toInt();
threadsHandler()->setCurrentThreadId(currentThreadId); threadsHandler()->setCurrentThreadId(currentThreadId);
plugin()->updateState(this); // Adjust Threads combobox. updateViews(); // Adjust Threads combobox.
if (m_hasInferiorThreadList) if (m_hasInferiorThreadList) {
postCommand("threadnames " + theDebuggerAction(MaximalStackDepth)->value().toByteArray(), CB(handleThreadNames), id); postCommand("threadnames " +
theDebuggerAction(MaximalStackDepth)->value().toByteArray(),
CB(handleThreadNames), id);
}
} else { } else {
// Fall back for older versions: Try to get at least a list // Fall back for older versions: Try to get at least a list
// of running threads. // of running threads.
@@ -3034,15 +3037,15 @@ void GdbEngine::handleThreadNames(const GdbResponse &response)
for (int index = 0, n = threads.size(); index != n; ++index) { for (int index = 0, n = threads.size(); index != n; ++index) {
ThreadData & thread = threads[index]; ThreadData & thread = threads[index];
if (thread.id == (quint64)id) { if (thread.id == (quint64)id) {
thread.name = decodeData(name.findChild("value").data(), name.findChild("valueencoded").data().toInt()); thread.name = decodeData(name.findChild("value").data(),
name.findChild("valueencoded").data().toInt());
break; break;
} }
} }
} }
threadsHandler()->setThreads(threads); threadsHandler()->setThreads(threads);
plugin()->updateState(this); updateViews();
} }
} }