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:
hjk
2010-06-16 11:08:54 +02:00
parent 4cc244469a
commit 6a6cba5518
93 changed files with 5258 additions and 4846 deletions

View File

@@ -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;