Commit 7cd32722 authored by hjk's avatar hjk

debugger: make memory view updatable

Task-number: QTCREATORBUG-3242
parent cfd2dbb3
......@@ -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";
......
......@@ -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;
......
......@@ -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;
......
......@@ -3530,6 +3530,7 @@ void GdbEngine::updateLocals(const QVariant &cookie)
updateLocalsPython(false, QByteArray());
else
updateLocalsClassic(cookie);
debuggerCore()->updateMemoryEditors();
}
......
......@@ -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));
......
......@@ -1859,6 +1859,13 @@ public:
Foo *f;
};
void testMemoryView()
{
int a[20];
for (int i = 0; i != 20; ++i)
a[i] = i;
}
void testUninitialized()
{
QString s;
......@@ -2111,6 +2118,7 @@ void testQSettings()
int main(int argc, char *argv[])
{
testMemoryView();
//testQSettings();
//testWCout0();
//testWCout();
......
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