2013-10-25 13:47:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-10-25 13:47:08 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-10-25 13:47:08 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-10-25 13:47:08 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-10-25 13:47:08 +02:00
|
|
|
|
|
|
|
|
#include "debugger_global.h"
|
|
|
|
|
#include "debuggerconstants.h"
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/abi.h>
|
|
|
|
|
|
|
|
|
|
#include <utils/fileutils.h>
|
|
|
|
|
|
2016-03-06 23:26:01 +02:00
|
|
|
#include <QDateTime>
|
2013-10-25 13:47:08 +02:00
|
|
|
#include <QList>
|
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
|
2013-11-27 12:32:43 +01:00
|
|
|
class DebuggerItemManager;
|
2015-03-03 16:49:59 +01:00
|
|
|
|
2013-11-12 15:11:04 +01:00
|
|
|
namespace Internal {
|
2015-03-03 16:49:59 +01:00
|
|
|
class DebuggerConfigWidget;
|
2013-11-12 15:11:04 +01:00
|
|
|
class DebuggerItemConfigWidget;
|
|
|
|
|
class DebuggerItemModel;
|
|
|
|
|
} // namespace Internal
|
2013-10-28 17:47:37 +01:00
|
|
|
|
2013-10-25 13:47:08 +02:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
// DebuggerItem
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
class DEBUGGER_EXPORT DebuggerItem
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
DebuggerItem();
|
|
|
|
|
DebuggerItem(const QVariantMap &data);
|
|
|
|
|
|
2013-11-06 16:10:24 +01:00
|
|
|
void createId();
|
2013-10-25 13:47:08 +02:00
|
|
|
bool canClone() const { return true; }
|
|
|
|
|
bool isValid() const;
|
|
|
|
|
QString engineTypeName() const;
|
|
|
|
|
|
|
|
|
|
QVariantMap toMap() const;
|
|
|
|
|
|
|
|
|
|
QVariant id() const { return m_id; }
|
|
|
|
|
|
2015-03-03 16:49:59 +01:00
|
|
|
QString displayName() const;
|
|
|
|
|
QString unexpandedDisplayName() const { return m_unexpandedDisplayName; }
|
|
|
|
|
void setUnexpandedDisplayName(const QString &unexpandedDisplayName);
|
2013-10-25 13:47:08 +02:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
2014-06-23 17:59:27 +02:00
|
|
|
QString version() const;
|
|
|
|
|
void setVersion(const QString &version);
|
|
|
|
|
|
2013-12-03 17:25:38 +01:00
|
|
|
QString autoDetectionSource() const { return m_autoDetectionSource; }
|
|
|
|
|
void setAutoDetectionSource(const QString &autoDetectionSource);
|
|
|
|
|
|
2013-10-25 13:47:08 +02:00
|
|
|
QList<ProjectExplorer::Abi> abis() const { return m_abis; }
|
|
|
|
|
void setAbis(const QList<ProjectExplorer::Abi> &abis);
|
|
|
|
|
void setAbi(const ProjectExplorer::Abi &abi);
|
|
|
|
|
|
2014-07-29 14:19:40 +02:00
|
|
|
enum MatchLevel { DoesNotMatch, MatchesSomewhat, MatchesWell, MatchesPerfectly };
|
2013-10-25 13:47:08 +02:00
|
|
|
MatchLevel matchTarget(const ProjectExplorer::Abi &targetAbi) const;
|
|
|
|
|
|
|
|
|
|
QStringList abiNames() const;
|
2016-03-06 23:26:01 +02:00
|
|
|
QDateTime lastModified() const;
|
2013-10-25 13:47:08 +02:00
|
|
|
|
2015-09-07 12:13:03 +02:00
|
|
|
bool isGood() const;
|
|
|
|
|
QString validityMessage() const;
|
|
|
|
|
|
2013-10-28 12:51:35 +01:00
|
|
|
bool operator==(const DebuggerItem &other) const;
|
2014-12-19 10:46:40 +01:00
|
|
|
bool operator!=(const DebuggerItem &other) const { return !operator==(other); }
|
2013-10-28 12:51:35 +01:00
|
|
|
|
2016-04-29 19:05:08 +02:00
|
|
|
void reinitializeFromFile();
|
|
|
|
|
|
2013-10-25 13:47:08 +02:00
|
|
|
private:
|
2013-10-28 17:47:37 +01:00
|
|
|
DebuggerItem(const QVariant &id);
|
2015-03-03 16:49:59 +01:00
|
|
|
void initMacroExpander();
|
2013-10-28 17:47:37 +01:00
|
|
|
|
2013-10-25 13:47:08 +02:00
|
|
|
QVariant m_id;
|
2015-03-03 16:49:59 +01:00
|
|
|
QString m_unexpandedDisplayName;
|
2013-10-25 13:47:08 +02:00
|
|
|
DebuggerEngineType m_engineType;
|
|
|
|
|
Utils::FileName m_command;
|
|
|
|
|
bool m_isAutoDetected;
|
2013-12-03 17:25:38 +01:00
|
|
|
QString m_autoDetectionSource;
|
2014-06-23 17:59:27 +02:00
|
|
|
QString m_version;
|
2013-10-25 13:47:08 +02:00
|
|
|
QList<ProjectExplorer::Abi> m_abis;
|
2016-03-06 23:26:01 +02:00
|
|
|
QDateTime m_lastModified;
|
2013-10-28 17:47:37 +01:00
|
|
|
|
2015-03-03 16:49:59 +01:00
|
|
|
friend class Internal::DebuggerConfigWidget;
|
2013-11-12 15:11:04 +01:00
|
|
|
friend class Internal::DebuggerItemConfigWidget;
|
2013-10-28 17:47:37 +01:00
|
|
|
friend class Internal::DebuggerItemModel;
|
2013-11-27 12:32:43 +01:00
|
|
|
friend class DebuggerItemManager;
|
2013-10-25 13:47:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Debugger
|