2013-09-12 18:46:35 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 Tim Sander <tim@krieglstein.org>
|
|
|
|
|
** Copyright (C) 2016 Denis Shienkov <denis.shienkov@gmail.com>
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-09-12 18:46:35 +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-09-12 18:46:35 +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-09-12 18:46:35 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "baremetalplugin.h"
|
|
|
|
|
#include "baremetalconstants.h"
|
2018-03-20 17:00:19 +01:00
|
|
|
#include "baremetalcustomrunconfiguration.h"
|
2019-02-20 19:13:28 +01:00
|
|
|
#include "baremetaldevice.h"
|
2017-07-07 18:49:26 +02:00
|
|
|
#include "baremetaldebugsupport.h"
|
|
|
|
|
#include "baremetalrunconfiguration.h"
|
2013-09-12 18:46:35 +02:00
|
|
|
|
2014-12-20 19:10:02 +00:00
|
|
|
#include "gdbserverproviderssettingspage.h"
|
|
|
|
|
#include "gdbserverprovidermanager.h"
|
|
|
|
|
|
2013-09-12 18:46:35 +02:00
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
#include <coreplugin/icontext.h>
|
|
|
|
|
#include <coreplugin/actionmanager/actionmanager.h>
|
|
|
|
|
#include <coreplugin/actionmanager/command.h>
|
|
|
|
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
|
|
|
|
#include <coreplugin/coreconstants.h>
|
|
|
|
|
|
2017-07-07 18:49:26 +02:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
2013-09-12 18:46:35 +02:00
|
|
|
namespace BareMetal {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2019-02-21 14:59:57 +01:00
|
|
|
class BareMetalPluginPrivate
|
2018-01-26 17:23:45 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2019-02-20 19:13:28 +01:00
|
|
|
BareMetalDeviceFactory deviceFactory;
|
2018-01-26 17:23:45 +01:00
|
|
|
BareMetalRunConfigurationFactory runConfigurationFactory;
|
|
|
|
|
BareMetalCustomRunConfigurationFactory customRunConfigurationFactory;
|
|
|
|
|
GdbServerProvidersSettingsPage gdbServerProviderSettinsPage;
|
|
|
|
|
GdbServerProviderManager gdbServerProviderManager;
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-12 18:46:35 +02:00
|
|
|
BareMetalPlugin::~BareMetalPlugin()
|
|
|
|
|
{
|
2019-02-21 14:59:57 +01:00
|
|
|
delete d;
|
2013-09-12 18:46:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool BareMetalPlugin::initialize(const QStringList &arguments, QString *errorString)
|
|
|
|
|
{
|
2018-01-26 17:23:45 +01:00
|
|
|
Q_UNUSED(arguments)
|
|
|
|
|
Q_UNUSED(errorString)
|
2013-09-12 18:46:35 +02:00
|
|
|
|
2019-02-21 14:59:57 +01:00
|
|
|
d = new BareMetalPluginPrivate;
|
2013-09-12 18:46:35 +02:00
|
|
|
|
2018-01-26 17:23:45 +01:00
|
|
|
auto constraint = [](RunConfiguration *runConfig) {
|
|
|
|
|
const QByteArray idStr = runConfig->id().name();
|
2018-04-26 12:16:47 +02:00
|
|
|
const bool res = idStr.startsWith(BareMetalRunConfiguration::IdPrefix)
|
|
|
|
|
|| idStr == BareMetalCustomRunConfiguration::Id;
|
|
|
|
|
return res;
|
2018-01-26 17:23:45 +01:00
|
|
|
};
|
2017-07-07 18:49:26 +02:00
|
|
|
|
2018-01-26 17:23:45 +01:00
|
|
|
RunControl::registerWorker<BareMetalDebugSupport>
|
|
|
|
|
(ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint);
|
|
|
|
|
RunControl::registerWorker<BareMetalDebugSupport>
|
|
|
|
|
(ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint);
|
2017-07-07 18:49:26 +02:00
|
|
|
|
2018-01-26 17:23:45 +01:00
|
|
|
return true;
|
2013-09-12 18:46:35 +02:00
|
|
|
}
|
|
|
|
|
|
2014-12-20 19:10:02 +00:00
|
|
|
void BareMetalPlugin::extensionsInitialized()
|
|
|
|
|
{
|
|
|
|
|
GdbServerProviderManager::instance()->restoreProviders();
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-12 18:46:35 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace BareMetal
|