2013-10-25 13:47:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2013-10-25 13:47:08 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
|
|
|
|
**
|
|
|
|
|
** 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
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
2014-10-01 13:21:18 +02:00
|
|
|
** conditions see http://www.qt.io/licensing. For further information
|
|
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2013-10-25 13:47:08 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2013-10-25 13:47:08 +02:00
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUGGER_DEBUGGERITEM_H
|
|
|
|
|
#define DEBUGGER_DEBUGGERITEM_H
|
|
|
|
|
|
|
|
|
|
#include "debugger_global.h"
|
|
|
|
|
#include "debuggerconstants.h"
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/abi.h>
|
|
|
|
|
|
|
|
|
|
#include <utils/fileutils.h>
|
2014-10-13 12:49:05 +02:00
|
|
|
#include <utils/macroexpander.h>
|
2013-10-25 13:47:08 +02:00
|
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
|
2013-11-27 12:32:43 +01:00
|
|
|
class DebuggerItemManager;
|
2013-11-12 15:11:04 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
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; }
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
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;
|
|
|
|
|
|
2013-10-28 12:51:35 +01:00
|
|
|
bool operator==(const DebuggerItem &other) const;
|
|
|
|
|
|
2013-10-25 13:47:08 +02:00
|
|
|
private:
|
2013-10-28 17:47:37 +01:00
|
|
|
DebuggerItem(const QVariant &id);
|
2013-11-27 12:32:43 +01:00
|
|
|
void reinitializeFromFile();
|
2013-10-28 17:47:37 +01:00
|
|
|
|
2013-10-25 13:47:08 +02:00
|
|
|
QVariant m_id;
|
|
|
|
|
QString m_displayName;
|
|
|
|
|
DebuggerEngineType m_engineType;
|
|
|
|
|
Utils::FileName m_command;
|
|
|
|
|
bool m_isAutoDetected;
|
2013-12-03 17:25:38 +01:00
|
|
|
QString m_autoDetectionSource;
|
2013-10-25 13:47:08 +02:00
|
|
|
QList<ProjectExplorer::Abi> m_abis;
|
2013-10-28 17:47:37 +01:00
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
#endif // DEBUGGER_DEBUGGERITEM_H
|