forked from qt-creator/qt-creator
Debugger: Move classes into their own files
Change-Id: I89853ffb4192b0da1f34d471e250d4ec32daa3da Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "debugger_global.h"
|
||||
#include "debuggerconstants.h"
|
||||
#include "debuggeritem.h"
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
@@ -40,102 +41,6 @@
|
||||
|
||||
namespace Debugger {
|
||||
|
||||
namespace Internal { class DebuggerItemModel; }
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// DebuggerItem
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
class DEBUGGER_EXPORT DebuggerItem
|
||||
{
|
||||
public:
|
||||
DebuggerItem();
|
||||
DebuggerItem(const QVariantMap &data);
|
||||
|
||||
bool canClone() const { return true; }
|
||||
bool isValid() const;
|
||||
QString engineTypeName() const;
|
||||
|
||||
QVariantMap toMap() const;
|
||||
void reinitializeFromFile();
|
||||
|
||||
QVariant id() const { return m_id; }
|
||||
|
||||
QString displayName() const { return m_displayName; }
|
||||
void setDisplayName(const QString &displayName);
|
||||
|
||||
DebuggerEngineType engineType() const { return m_engineType; }
|
||||
void setEngineType(const DebuggerEngineType &engineType);
|
||||
|
||||
Utils::FileName command() const { return m_command; }
|
||||
void setCommand(const Utils::FileName &command);
|
||||
|
||||
bool isAutoDetected() const { return m_isAutoDetected; }
|
||||
void setAutoDetected(bool isAutoDetected);
|
||||
|
||||
QList<ProjectExplorer::Abi> abis() const { return m_abis; }
|
||||
void setAbis(const QList<ProjectExplorer::Abi> &abis);
|
||||
void setAbi(const ProjectExplorer::Abi &abi);
|
||||
|
||||
enum MatchLevel { DoesNotMatch, MatchesSomewhat, MatchesPerfectly };
|
||||
MatchLevel matchTarget(const ProjectExplorer::Abi &targetAbi) const;
|
||||
|
||||
QStringList abiNames() const;
|
||||
|
||||
private:
|
||||
QVariant m_id;
|
||||
QString m_displayName;
|
||||
DebuggerEngineType m_engineType;
|
||||
Utils::FileName m_command;
|
||||
bool m_isAutoDetected;
|
||||
QList<ProjectExplorer::Abi> m_abis;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// DebuggerItemManager
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
class DEBUGGER_EXPORT DebuggerItemManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static QObject *instance();
|
||||
~DebuggerItemManager();
|
||||
|
||||
static QList<DebuggerItem> debuggers();
|
||||
static Debugger::Internal::DebuggerItemModel *model();
|
||||
|
||||
static QVariant registerDebugger(const DebuggerItem &item);
|
||||
static void deregisterDebugger(const DebuggerItem &item);
|
||||
|
||||
static const DebuggerItem *findByCommand(const Utils::FileName &command);
|
||||
static const DebuggerItem *findById(const QVariant &id);
|
||||
|
||||
static void restoreDebuggers();
|
||||
static QString uniqueDisplayName(const QString &base);
|
||||
static void setItemData(const QVariant &id, const QString& displayName, const Utils::FileName &fileName);
|
||||
|
||||
static void removeDebugger(const QVariant &id);
|
||||
static QVariant addDebugger(const DebuggerItem &item);
|
||||
|
||||
public slots:
|
||||
void saveDebuggers();
|
||||
|
||||
private:
|
||||
explicit DebuggerItemManager(QObject *parent = 0);
|
||||
static void autoDetectGdbOrLldbDebuggers();
|
||||
static void autoDetectCdbDebuggers();
|
||||
static void readLegacyDebuggers();
|
||||
|
||||
static Utils::PersistentSettingsWriter *m_writer;
|
||||
static QList<DebuggerItem> m_debuggers;
|
||||
static Debugger::Internal::DebuggerItemModel *m_model;
|
||||
|
||||
friend class Internal::DebuggerItemModel;
|
||||
friend class DebuggerPlugin; // Enable constrcutor for DebuggerPlugin
|
||||
};
|
||||
|
||||
class DEBUGGER_EXPORT DebuggerKitInformation : public ProjectExplorer::KitInformation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user