forked from qt-creator/qt-creator
debugger: The DebuggerEngine refactoring.
This replaces the (de facto) singleton engines and data handlers by classes that are instantiated per run. The DebuggerRunControl will now create an object of (a class derived from) DebuggerEngine that contains all the relevant "dynamic" data. DebuggerManager is no more. The "singleton" bits are merged into DebuggerPlugin, whereas the data bits went to DebuggerEngine. There is no formal notion of a "current" DebuggerEngine. However, as there's only one DebuggerEngine at a time that has its data models connected to the view, there's still some "de facto" notion of a "current" engine. Calling SomeModel::setData(int role, QVariant data) with custom role is used as the primary dispatch mechanism from the views to the "current" data models (and the engine, as all data models know their engine).
This commit is contained in:
@@ -36,11 +36,10 @@
|
||||
#include <QtCore/QDateTime>
|
||||
|
||||
namespace Debugger {
|
||||
|
||||
class DebuggerRunControl;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class DebuggerEngine;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SnapshotData
|
||||
@@ -64,8 +63,8 @@ public:
|
||||
void setLocation(const QString &location) { m_location = location; }
|
||||
QString location() const { return m_location; }
|
||||
|
||||
void setFrames(const QList<StackFrame> &frames) { m_frames = frames; }
|
||||
QList<StackFrame> frames() const { return m_frames; }
|
||||
void setFrames(const StackFrames &frames) { m_frames = frames; }
|
||||
StackFrames frames() const { return m_frames; }
|
||||
|
||||
QString function() const; // Topmost entry.
|
||||
|
||||
@@ -90,7 +89,7 @@ class SnapshotHandler : public QAbstractTableModel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SnapshotHandler(DebuggerRunControl *runControl, QObject *parent = 0);
|
||||
explicit SnapshotHandler(DebuggerEngine *engine);
|
||||
~SnapshotHandler();
|
||||
|
||||
void setFrames(const Snapshots &snapshots, bool canExpand = false);
|
||||
@@ -114,7 +113,7 @@ private:
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
Q_SLOT void resetModel() { reset(); }
|
||||
|
||||
DebuggerRunControl *m_runControl;
|
||||
DebuggerEngine *m_engine;
|
||||
int m_currentIndex;
|
||||
Snapshots m_snapshots;
|
||||
const QVariant m_positionIcon;
|
||||
|
||||
Reference in New Issue
Block a user