diff options
author | hjk <qtc-committer@nokia.com> | 2010-12-08 14:08:35 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2010-12-08 16:48:35 +0100 |
commit | 7cd32722829533e8114826b78f8b4433aa583fa6 (patch) | |
tree | bd99c543c4fd404ce307df983778e97a274c30b2 /src/plugins/debugger | |
parent | cfd2dbb3951667483e0c4bdd7626077fb2c78a46 (diff) | |
download | qt-creator-7cd32722829533e8114826b78f8b4433aa583fa6.tar.gz |
debugger: make memory view updatable
Task-number: QTCREATORBUG-3242
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r-- | src/plugins/debugger/debuggerconstants.h | 1 | ||||
-rw-r--r-- | src/plugins/debugger/debuggercore.h | 1 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 11 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 1 | ||||
-rw-r--r-- | src/plugins/debugger/memoryagent.cpp | 3 |
5 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index ec79f48863..3f734bd166 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -84,6 +84,7 @@ namespace Internal { const char * const OPENED_BY_DEBUGGER = "OpenedByDebugger"; const char * const OPENED_WITH_DISASSEMBLY = "DisassemblerView"; +const char * const OPENED_WITH_MEMORY = "MemoryView"; const char * const DEBUGMODE = "Debugger.DebugMode"; const char * const DEBUG = "Debugger.Debug"; diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h index 95820d8991..0fa30f388e 100644 --- a/src/plugins/debugger/debuggercore.h +++ b/src/plugins/debugger/debuggercore.h @@ -114,6 +114,7 @@ public: virtual void showModuleSymbols(const QString &moduleName, const QVector<Symbol> &symbols) = 0; virtual void openMemoryEditor() = 0; + virtual void updateMemoryEditors() = 0; virtual void languagesChanged() = 0; virtual Utils::SavedAction *action(int code) const = 0; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 8980634d1d..9063dd02ce 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1027,6 +1027,7 @@ public slots: void languagesChanged(); void showStatusMessage(const QString &msg, int timeout = -1); void openMemoryEditor(); + void updateMemoryEditors(); const CPlusPlus::Snapshot &cppCodeModelSnapshot() const; @@ -2433,6 +2434,16 @@ void DebuggerPluginPrivate::openMemoryEditor() currentEngine()->openMemoryView(dialog.address()); } +void DebuggerPluginPrivate::updateMemoryEditors() +{ + EditorManager *editorManager = EditorManager::instance(); + QTC_ASSERT(editorManager, return); + foreach (IEditor *editor, editorManager->openedEditors()) { + if (editor->property(Constants::OPENED_WITH_MEMORY).toBool()) + QMetaObject::invokeMethod(editor->widget(), "updateContents"); + } +} + void DebuggerPluginPrivate::coreShutdown() { m_shuttingDown = true; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 1e6e1691fb..63c858a8b5 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3530,6 +3530,7 @@ void GdbEngine::updateLocals(const QVariant &cookie) updateLocalsPython(false, QByteArray()); else updateLocalsClassic(cookie); + debuggerCore()->updateMemoryEditors(); } diff --git a/src/plugins/debugger/memoryagent.cpp b/src/plugins/debugger/memoryagent.cpp index 139fe3879d..8577357b97 100644 --- a/src/plugins/debugger/memoryagent.cpp +++ b/src/plugins/debugger/memoryagent.cpp @@ -87,6 +87,8 @@ void MemoryViewAgent::createBinEditor(quint64 addr) Core::Constants::K_DEFAULT_BINARY_EDITOR_ID, &titlePattern); if (editor) { + editor->setProperty(Debugger::Constants::OPENED_BY_DEBUGGER, true); + editor->setProperty(Debugger::Constants::OPENED_WITH_MEMORY, true); connect(editor->widget(), SIGNAL(lazyDataRequested(Core::IEditor *, quint64,bool)), SLOT(fetchLazyData(Core::IEditor *, quint64,bool))); @@ -103,7 +105,6 @@ void MemoryViewAgent::createBinEditor(quint64 addr) SIGNAL(endOfFileRequested(Core::IEditor *)), SLOT(handleEndOfFileRequested(Core::IEditor*))); m_editors << editor; - editorManager->activateEditor(editor); QMetaObject::invokeMethod(editor->widget(), "setNewWindowRequestAllowed"); QMetaObject::invokeMethod(editor->widget(), "setLazyData", Q_ARG(quint64, addr), Q_ARG(int, DataRange), Q_ARG(int, BinBlockSize)); |