diff --git a/src/plugins/bineditor/bineditor.cpp b/src/plugins/bineditor/bineditor.cpp index dd0369f557dfd16ee17617f5973abe06e9ec8869..9c6e0ff387f1dee544f747de451d409c59977ea3 100644 --- a/src/plugins/bineditor/bineditor.cpp +++ b/src/plugins/bineditor/bineditor.cpp @@ -176,7 +176,7 @@ void BinEditor::addData(quint64 block, const QByteArray &data) } } -bool BinEditor::requestDataAt(int pos, bool synchronous) const +bool BinEditor::requestDataAt(int pos) const { int block = pos / m_blockSize; BlockMap::const_iterator it = m_modifiedData.find(block); @@ -188,10 +188,8 @@ bool BinEditor::requestDataAt(int pos, bool synchronous) const if (!m_requests.contains(block)) { m_requests.insert(block); emit const_cast<BinEditor*>(this)-> - dataRequested(editor(), m_baseAddr / m_blockSize + block, - synchronous); - if (!m_requests.contains(block)) - return true; // synchronous data source + dataRequested(editor(), m_baseAddr / m_blockSize + block); + return true; } return false; } @@ -530,7 +528,7 @@ int BinEditor::dataIndexOf(const QByteArray &pattern, int from, bool caseSensiti const int end = qMin<qint64>(static_cast<qint64>(from) + SearchStride, m_size); while (from < end) { - if (!requestDataAt(block * m_blockSize, true)) + if (!requestDataAt(block * m_blockSize)) return -1; QByteArray data = blockData(block); ::memcpy(b, b + m_blockSize, trailing); @@ -561,7 +559,7 @@ int BinEditor::dataLastIndexOf(const QByteArray &pattern, int from, bool caseSen int block = from / m_blockSize; const int lowerBound = qMax(0, from - SearchStride); while (from > lowerBound) { - if (!requestDataAt(block * m_blockSize, true)) + if (!requestDataAt(block * m_blockSize)) return -1; QByteArray data = blockData(block); ::memcpy(b + m_blockSize, b, trailing); diff --git a/src/plugins/bineditor/bineditor.h b/src/plugins/bineditor/bineditor.h index 3e0024d97ca637b151700fe2f1051da58bba1b33..620432fbc0cc7743cbdd1ed474a23db62871a246 100644 --- a/src/plugins/bineditor/bineditor.h +++ b/src/plugins/bineditor/bineditor.h @@ -133,7 +133,7 @@ Q_SIGNALS: void copyAvailable(bool); void cursorPositionChanged(int position); - void dataRequested(Core::IEditor *editor, quint64 block, bool synchronous); + void dataRequested(Core::IEditor *editor, quint64 block); void newWindowRequested(quint64 address); void newRangeRequested(Core::IEditor *, quint64 address); void startOfFileRequested(Core::IEditor *); @@ -169,7 +169,7 @@ private: int dataIndexOf(const QByteArray &pattern, int from, bool caseSensitive = true) const; int dataLastIndexOf(const QByteArray &pattern, int from, bool caseSensitive = true) const; - bool requestDataAt(int pos, bool synchronous = false) const; + bool requestDataAt(int pos) const; bool requestOldDataAt(int pos) const; char dataAt(int pos, bool old = false) const; char oldDataAt(int pos) const; diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 47da50ef82b0f61d120b9a3ca706dc36e20cda34..2d785e6d189a9000616c9e21a3d6a21b38a4098a 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -185,7 +185,7 @@ public: Core::IFile(parent) { m_editor = parent; - connect(m_editor, SIGNAL(dataRequested(Core::IEditor *, quint64, bool)), + connect(m_editor, SIGNAL(dataRequested(Core::IEditor*,quint64)), this, SLOT(provideData(Core::IEditor *, quint64))); connect(m_editor, SIGNAL(newRangeRequested(Core::IEditor*,quint64)), this, SLOT(provideNewRange(Core::IEditor*,quint64))); diff --git a/src/plugins/debugger/memoryagent.cpp b/src/plugins/debugger/memoryagent.cpp index 607560cfa788e56df6ef82b1a463a79b1270beba..0b56157375f1755ab5dde08217f16d6119cc4340 100644 --- a/src/plugins/debugger/memoryagent.cpp +++ b/src/plugins/debugger/memoryagent.cpp @@ -92,8 +92,8 @@ void MemoryAgent::createBinEditor(quint64 addr) editor->setProperty(Constants::OPENED_BY_DEBUGGER, true); editor->setProperty(Constants::OPENED_WITH_MEMORY, true); connect(editor->widget(), - SIGNAL(dataRequested(Core::IEditor*,quint64,bool)), - SLOT(fetchLazyData(Core::IEditor*,quint64,bool))); + SIGNAL(dataRequested(Core::IEditor*,quint64)), + SLOT(fetchLazyData(Core::IEditor*,quint64))); connect(editor->widget(), SIGNAL(newWindowRequested(quint64)), SLOT(createBinEditor(quint64))); @@ -125,9 +125,8 @@ void MemoryAgent::createBinEditor(quint64 addr) } } -void MemoryAgent::fetchLazyData(IEditor *editor, quint64 block, bool sync) +void MemoryAgent::fetchLazyData(IEditor *editor, quint64 block) { - Q_UNUSED(sync); // FIXME: needed support for incremental searching m_engine->fetchMemory(this, editor, BinBlockSize * block, BinBlockSize); } diff --git a/src/plugins/debugger/memoryagent.h b/src/plugins/debugger/memoryagent.h index 31a69cbf22da5eec74660725b6abbd8ed645d0f5..20c0632c44cec35cb70fc06fe453994ba4a2f1a4 100644 --- a/src/plugins/debugger/memoryagent.h +++ b/src/plugins/debugger/memoryagent.h @@ -63,16 +63,18 @@ public slots: void createBinEditor(quint64 startAddr); // Called by engine to trigger update of contents. void updateContents(); - // Called by enine to pass updated contents. + // Called by engine to pass updated contents. void addLazyData(QObject *editorToken, quint64 addr, const QByteArray &data); -private: - Q_SLOT void fetchLazyData(Core::IEditor *, quint64 block, bool sync); - Q_SLOT void provideNewRange(Core::IEditor *editor, quint64 address); - Q_SLOT void handleStartOfFileRequested(Core::IEditor *editor); - Q_SLOT void handleEndOfFileRequested(Core::IEditor *editor); - Q_SLOT void handleDataChanged(Core::IEditor *editor, quint64 address, const QByteArray &data); +private slots: + void fetchLazyData(Core::IEditor *, quint64 block); + void provideNewRange(Core::IEditor *editor, quint64 address); + void handleStartOfFileRequested(Core::IEditor *editor); + void handleEndOfFileRequested(Core::IEditor *editor); + void handleDataChanged(Core::IEditor *editor, quint64 address, + const QByteArray &data); +private: QList<QPointer<Core::IEditor> > m_editors; QPointer<DebuggerEngine> m_engine; };