summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Sander <tim@krieglstein.org>2013-09-12 18:46:35 +0200
committerTim Sander <tim@krieglstein.org>2013-09-20 14:24:32 +0200
commit3fbeca21d2c1c3d073a4a0a94cacaebe4ffeb606 (patch)
tree65e0dd91645e130fd08b7ffe75b4fc1076624aa4
parentee1bac2ee66dec914a8e414495792d4fe8d419c3 (diff)
downloadqt-creator-3fbeca21d2c1c3d073a4a0a94cacaebe4ffeb606.tar.gz
add baremetal plugin
This patch adds the baremetal plugin. The baremetal plugin is for debugging small targets with hardware debugger where the remote linux plugin does not fit. It adds a new kit and device class of type baremetal. The device allows entering custom gdb commands. Currently only qmake builds are possible. To use this with smaller devices without qt a fake-qt installation is needed. CMake and qbs is currently not supported. Change-Id: I86816f897a2e9ed8b95e3184387969cedf8a14d7 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
-rw-r--r--src/plugins/baremetal/BareMetal.pluginspec.in17
-rw-r--r--src/plugins/baremetal/baremetal.pro40
-rw-r--r--src/plugins/baremetal/baremetal_dependencies.pri13
-rw-r--r--src/plugins/baremetal/baremetalconstants.h45
-rw-r--r--src/plugins/baremetal/baremetaldeployconfiguration.cpp52
-rw-r--r--src/plugins/baremetal/baremetaldeployconfiguration.h71
-rw-r--r--src/plugins/baremetal/baremetaldeployconfigurationfactory.cpp128
-rw-r--r--src/plugins/baremetal/baremetaldeployconfigurationfactory.h58
-rw-r--r--src/plugins/baremetal/baremetaldeploystepfactory.cpp104
-rw-r--r--src/plugins/baremetal/baremetaldeploystepfactory.h56
-rw-r--r--src/plugins/baremetal/baremetaldevice.cpp95
-rw-r--r--src/plugins/baremetal/baremetaldevice.h68
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationfactory.cpp80
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationfactory.h54
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp97
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwidget.h61
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwidget.ui82
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp84
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwizard.h58
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp93
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h69
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwizardsetuppage.ui78
-rw-r--r--src/plugins/baremetal/baremetalgdbcommandsdeploystep.cpp142
-rw-r--r--src/plugins/baremetal/baremetalgdbcommandsdeploystep.h91
-rw-r--r--src/plugins/baremetal/baremetalplugin.cpp128
-rw-r--r--src/plugins/baremetal/baremetalplugin.h61
-rw-r--r--src/plugins/baremetal/baremetalrunconfiguration.cpp213
-rw-r--r--src/plugins/baremetal/baremetalrunconfiguration.h95
-rw-r--r--src/plugins/baremetal/baremetalrunconfigurationfactory.cpp133
-rw-r--r--src/plugins/baremetal/baremetalrunconfigurationfactory.h65
-rw-r--r--src/plugins/baremetal/baremetalrunconfigurationwidget.cpp162
-rw-r--r--src/plugins/baremetal/baremetalrunconfigurationwidget.h71
-rw-r--r--src/plugins/baremetal/baremetalruncontrolfactory.cpp137
-rw-r--r--src/plugins/baremetal/baremetalruncontrolfactory.h55
-rw-r--r--src/plugins/debugger/debuggerstartparameters.h5
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp7
-rw-r--r--src/plugins/debugger/gdb/gdbplainengine.cpp5
-rw-r--r--src/plugins/plugins.pro3
38 files changed, 2873 insertions, 3 deletions
diff --git a/src/plugins/baremetal/BareMetal.pluginspec.in b/src/plugins/baremetal/BareMetal.pluginspec.in
new file mode 100644
index 0000000000..fb4d476f93
--- /dev/null
+++ b/src/plugins/baremetal/BareMetal.pluginspec.in
@@ -0,0 +1,17 @@
+<plugin name=\"BareMetal\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_COMPAT_VERSION\" experimental=\"true\">
+ <vendor>Tim Sander</vendor>
+ <copyright>Copyright (C) 2013 Tim Sander</copyright>
+ <license>
+ Commercial Usage
+
+ Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Digia.
+
+ GNU Lesser General Public License Usage
+
+ Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ </license>
+ <description>This plugin adds a target for bare metal development.</description>
+ <category>Device Support</category>
+ <url></url>
+ $$dependencyList
+</plugin>
diff --git a/src/plugins/baremetal/baremetal.pro b/src/plugins/baremetal/baremetal.pro
new file mode 100644
index 0000000000..15d1e06004
--- /dev/null
+++ b/src/plugins/baremetal/baremetal.pro
@@ -0,0 +1,40 @@
+QT += network
+PROVIDER = Sander
+include(../../qtcreatorplugin.pri)
+
+# BareMetal files
+
+SOURCES += baremetalplugin.cpp \
+ baremetaldevice.cpp \
+ baremetaldeployconfigurationfactory.cpp \
+ baremetaldeployconfiguration.cpp \
+ baremetalrunconfigurationfactory.cpp \
+ baremetalrunconfiguration.cpp \
+ baremetalrunconfigurationwidget.cpp \
+ baremetaldeploystepfactory.cpp \
+ baremetalgdbcommandsdeploystep.cpp \
+ baremetalruncontrolfactory.cpp \
+ baremetaldeviceconfigurationwizardpages.cpp \
+ baremetaldeviceconfigurationwizard.cpp \
+ baremetaldeviceconfigurationwidget.cpp \
+ baremetaldeviceconfigurationfactory.cpp
+
+HEADERS += baremetalplugin.h \
+ baremetalconstants.h \
+ baremetaldevice.h \
+ baremetaldeployconfigurationfactory.h \
+ baremetaldeployconfiguration.h \
+ baremetalrunconfigurationfactory.h \
+ baremetalrunconfiguration.h \
+ baremetalrunconfigurationwidget.h \
+ baremetaldeploystepfactory.h \
+ baremetalgdbcommandsdeploystep.h \
+ baremetalruncontrolfactory.h \
+ baremetaldeviceconfigurationfactory.h \
+ baremetaldeviceconfigurationwidget.h \
+ baremetaldeviceconfigurationwizard.h \
+ baremetaldeviceconfigurationwizardpages.h
+
+FORMS += \
+ baremetaldeviceconfigurationwizardsetuppage.ui \
+ baremetaldeviceconfigurationwidget.ui
diff --git a/src/plugins/baremetal/baremetal_dependencies.pri b/src/plugins/baremetal/baremetal_dependencies.pri
new file mode 100644
index 0000000000..557e8047e6
--- /dev/null
+++ b/src/plugins/baremetal/baremetal_dependencies.pri
@@ -0,0 +1,13 @@
+QTC_PLUGIN_NAME = BareMetal
+QTC_LIB_DEPENDS += \
+ # nothing here at this time
+
+QTC_PLUGIN_DEPENDS += \
+ coreplugin \
+ debugger \
+ projectexplorer \
+ qtsupport
+
+QTC_PLUGIN_RECOMMENDS += \
+ # optional plugin dependencies. nothing here at this time
+
diff --git a/src/plugins/baremetal/baremetalconstants.h b/src/plugins/baremetal/baremetalconstants.h
new file mode 100644
index 0000000000..8e6483dd8f
--- /dev/null
+++ b/src/plugins/baremetal/baremetalconstants.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALCONSTANTS_H
+#define BAREMETALCONSTANTS_H
+
+namespace BareMetal {
+namespace Constants {
+
+const char BareMetalOsType[] = "BareMetalOsType";
+
+const char ACTION_ID[] = "BareMetal.Action";
+const char MENU_ID[] = "BareMetal.Menu";
+
+} // namespace BareMetal
+} // namespace Constants
+
+#endif // BAREMETALCONSTANTS_H
+
diff --git a/src/plugins/baremetal/baremetaldeployconfiguration.cpp b/src/plugins/baremetal/baremetaldeployconfiguration.cpp
new file mode 100644
index 0000000000..36cf5a01fc
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeployconfiguration.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetaldeployconfiguration.h"
+
+using namespace ProjectExplorer;
+
+namespace BareMetal {
+
+BareMetalDeployConfiguration::BareMetalDeployConfiguration(Target *target,
+ const Core::Id id, const QString &defaultDisplayName) :
+ DeployConfiguration(target, id)
+{
+ setDefaultDisplayName(defaultDisplayName);
+}
+
+BareMetalDeployConfiguration::BareMetalDeployConfiguration(Target *target, BareMetalDeployConfiguration *source):
+ DeployConfiguration(target, source)
+{ }
+
+NamedWidget *BareMetalDeployConfiguration::createConfigWidget()
+{
+ return 0;
+}
+
+} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetaldeployconfiguration.h b/src/plugins/baremetal/baremetaldeployconfiguration.h
new file mode 100644
index 0000000000..3938e6473a
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeployconfiguration.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALDEPLOYCONFIGURATION_H
+#define BAREMETALDEPLOYCONFIGURATION_H
+
+#include "baremetaldeployconfiguration.h"
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/deployconfiguration.h>
+
+namespace BareMetal {
+namespace Internal {
+class BareMetalDeployConfigurationFactory;
+} // namespace Internal
+
+class BareMetalDeployConfiguration : public ProjectExplorer::DeployConfiguration
+{
+ Q_OBJECT
+public:
+ BareMetalDeployConfiguration(ProjectExplorer::Target *target, const Core::Id id,
+ const QString &defaultDisplayName);
+ BareMetalDeployConfiguration(ProjectExplorer::Target *target,
+ BareMetalDeployConfiguration *source);
+
+ ProjectExplorer::NamedWidget *createConfigWidget();
+
+ template<class T> T *earlierBuildStep(const ProjectExplorer::BuildStep *laterBuildStep) const
+ {
+ foreach (const ProjectExplorer::BuildStep *step, stepList()->steps()) {
+ if (step == laterBuildStep)
+ return 0;
+ if (T * const step = dynamic_cast<T *>(step))
+ return step;
+ }
+ return 0;
+ }
+
+private:
+ friend class Internal::BareMetalDeployConfigurationFactory;
+
+};
+
+} // namespace BareMetal
+
+#endif // BAREMETALDEPLOYCONFIGURATION_H
diff --git a/src/plugins/baremetal/baremetaldeployconfigurationfactory.cpp b/src/plugins/baremetal/baremetaldeployconfigurationfactory.cpp
new file mode 100644
index 0000000000..87f1e5f311
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeployconfigurationfactory.cpp
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+
+#include "baremetaldeployconfigurationfactory.h"
+#include "baremetalconstants.h"
+#include "baremetaldeployconfiguration.h"
+
+#include <projectexplorer/abi.h>
+#include <projectexplorer/toolchain.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/target.h>
+
+#include <utils/qtcassert.h>
+
+using namespace ProjectExplorer;
+
+namespace BareMetal {
+namespace Internal {
+namespace {
+QString genericBareMetalDisplayName() {
+ return QCoreApplication::translate("BareMetal","Run on gdbserver/Hardware Debugger");
+}
+} // anonymous namespace
+
+
+BareMetalDeployConfigurationFactory::BareMetalDeployConfigurationFactory(QObject *parent) :
+ DeployConfigurationFactory(parent)
+{
+ setObjectName(QLatin1String("BareMetalDeployConfiguration"));
+}
+
+QList<Core::Id> BareMetalDeployConfigurationFactory::availableCreationIds(Target *parent) const
+{
+ QList<Core::Id> ids;
+ if (!parent->project()->supportsKit(parent->kit()))
+ return ids;
+ ToolChain *tc
+ = ToolChainKitInformation::toolChain(parent->kit());
+ if (!tc || tc->targetAbi().os() != Abi::LinuxOS) //FIXME
+ return ids;
+ const Core::Id devType = DeviceTypeKitInformation::deviceTypeId(parent->kit());
+ if (devType == Constants::BareMetalOsType)
+ ids << genericDeployConfigurationId();
+ return ids;
+}
+
+QString BareMetalDeployConfigurationFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == genericDeployConfigurationId())
+ return genericBareMetalDisplayName();
+ return QString();
+}
+
+bool BareMetalDeployConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
+{
+ return availableCreationIds(parent).contains(id);
+}
+
+DeployConfiguration *BareMetalDeployConfigurationFactory::create(Target *parent, const Core::Id id)
+{
+ QTC_ASSERT(canCreate(parent, id), return 0);
+ DeployConfiguration * const dc = new BareMetalDeployConfiguration(parent,id,genericBareMetalDisplayName());
+//FIXME dc->stepList()->insertStep(0, Step);
+ return dc;
+}
+
+bool BareMetalDeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
+{
+ return canCreate(parent,idFromMap(map));
+}
+
+DeployConfiguration *BareMetalDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
+{
+ if (!canRestore(parent,map))
+ return 0;
+ Core::Id id = idFromMap(map);
+ BareMetalDeployConfiguration * const dc = new BareMetalDeployConfiguration(parent, id, genericBareMetalDisplayName());
+ if (!dc->fromMap(map)) {
+ delete dc;
+ return 0;
+ }
+ return dc;
+}
+
+DeployConfiguration *BareMetalDeployConfigurationFactory::clone(Target *parent, DeployConfiguration *product)
+{
+ if (!canClone(parent, product))
+ return 0;
+ return new BareMetalDeployConfiguration(parent,
+ qobject_cast<BareMetalDeployConfiguration*>(product));
+}
+
+Core::Id BareMetalDeployConfigurationFactory::genericDeployConfigurationId()
+{
+ return Core::Id("DeployToBareMetal");
+}
+
+} // namespace Internal
+} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetaldeployconfigurationfactory.h b/src/plugins/baremetal/baremetaldeployconfigurationfactory.h
new file mode 100644
index 0000000000..b91439482a
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeployconfigurationfactory.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALDEPLOYCONFIGURATIONFACTORY_H
+#define BAREMETALDEPLOYCONFIGURATIONFACTORY_H
+
+#include <projectexplorer/deployconfiguration.h>
+
+namespace BareMetal {
+namespace Internal {
+
+class BareMetalDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory
+{
+ Q_OBJECT
+public:
+ explicit BareMetalDeployConfigurationFactory(QObject *parent = 0);
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
+ ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
+ ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
+ ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent,
+ ProjectExplorer::DeployConfiguration *product);
+
+ static Core::Id genericDeployConfigurationId();
+};
+
+} // namespace Internal
+} // namespace BareMetal
+#endif // BAREMETALDEPLOYCONFIGURATIONFACTORY_H
diff --git a/src/plugins/baremetal/baremetaldeploystepfactory.cpp b/src/plugins/baremetal/baremetaldeploystepfactory.cpp
new file mode 100644
index 0000000000..f3a77d4d05
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeploystepfactory.cpp
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetaldeploystepfactory.h"
+
+#include <baremetaldeployconfiguration.h>
+#include <baremetalgdbcommandsdeploystep.h>
+
+#include <utils/qtcassert.h>
+
+using namespace ProjectExplorer;
+
+namespace BareMetal {
+namespace Internal {
+BareMetalDeployStepFactory::BareMetalDeployStepFactory(QObject *parent) :
+ IBuildStepFactory(parent)
+{
+}
+
+QList<Core::Id> BareMetalDeployStepFactory::availableCreationIds(BuildStepList *parent) const
+{
+ QList<Core::Id> ids;
+ if (!qobject_cast<BareMetalDeployConfiguration *>(parent->parent()))
+ return ids;
+ ids << BareMetalGdbCommandsDeployStep::stepId();
+ return ids;
+}
+
+QString BareMetalDeployStepFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == BareMetalGdbCommandsDeployStep::stepId())
+ return BareMetalGdbCommandsDeployStep::displayName();
+ return QString();
+}
+
+bool BareMetalDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
+{
+ return availableCreationIds(parent).contains(id);
+}
+
+BuildStep *BareMetalDeployStepFactory::create(BuildStepList *parent, const Core::Id id)
+{
+ QTC_ASSERT(canCreate(parent, id), return 0);
+ if (id == BareMetalGdbCommandsDeployStep::stepId())
+ return new BareMetalGdbCommandsDeployStep(parent, id);
+ return 0;
+}
+
+bool BareMetalDeployStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
+{
+ return canCreate(parent, idFromMap(map));
+}
+
+BuildStep *BareMetalDeployStepFactory::restore(BuildStepList *parent, const QVariantMap &map)
+{
+ QTC_ASSERT(canRestore(parent, map), return 0);
+ BuildStep * const step = create(parent, idFromMap(map));
+ if (!step->fromMap(map)) {
+ delete step;
+ return 0;
+ }
+ return step;
+}
+
+bool BareMetalDeployStepFactory::canClone(BuildStepList *parent, BuildStep *product) const
+{
+ return canCreate(parent, product->id());
+}
+
+BuildStep *BareMetalDeployStepFactory::clone(BuildStepList *parent, BuildStep *product)
+{
+ if (BareMetalGdbCommandsDeployStep * const other = qobject_cast<BareMetalGdbCommandsDeployStep *>(product))
+ return new BareMetalGdbCommandsDeployStep(parent, other);
+ return 0;
+}
+
+} // namespace Internal
+} // namepsace BareMetal
diff --git a/src/plugins/baremetal/baremetaldeploystepfactory.h b/src/plugins/baremetal/baremetaldeploystepfactory.h
new file mode 100644
index 0000000000..5ab81f9e1c
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeploystepfactory.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALDEPLOYSTEPFACTORY_H
+#define BAREMETALDEPLOYSTEPFACTORY_H
+
+#include <projectexplorer/buildstep.h>
+
+namespace BareMetal {
+namespace Internal {
+
+class BareMetalDeployStepFactory : public ProjectExplorer::IBuildStepFactory
+{
+ Q_OBJECT
+public:
+ explicit BareMetalDeployStepFactory(QObject *parent = 0);
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+ bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
+ ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
+ bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
+ ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
+ bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const;
+ ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product);
+};
+
+} // namespace Internal
+} // namespace BareMetal
+#endif // BAREMETALDEPLOYSTEPFACTORY_H
diff --git a/src/plugins/baremetal/baremetaldevice.cpp b/src/plugins/baremetal/baremetaldevice.cpp
new file mode 100644
index 0000000000..44a8c2fa0f
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldevice.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetaldevice.h"
+#include "baremetaldeviceconfigurationwidget.h"
+#include <coreplugin/id.h>
+#include <utils/qtcassert.h>
+
+using namespace ProjectExplorer;
+
+namespace BareMetal {
+namespace Internal {
+
+BareMetalDevice::Ptr BareMetalDevice::create()
+{
+ return Ptr(new BareMetalDevice);
+}
+
+BareMetalDevice::Ptr BareMetalDevice::create(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id)
+{
+ return Ptr(new BareMetalDevice(name, type, machineType, origin, id));
+}
+
+BareMetalDevice::IDevice::Ptr BareMetalDevice::clone() const
+{
+ return Ptr(new BareMetalDevice(*this));
+}
+
+QString BareMetalDevice::displayType() const
+{
+ return tr("Bare Metal");
+}
+
+ProjectExplorer::IDeviceWidget *BareMetalDevice::createWidget()
+{
+ return new BareMetalDeviceConfigurationWidget(sharedFromThis());
+}
+
+QList<Core::Id> BareMetalDevice::actionIds() const
+{
+ return QList<Core::Id>(); //FIXME complete?
+}
+
+QString BareMetalDevice::displayNameForActionId(Core::Id actionId) const
+{
+ QTC_ASSERT(actionIds().contains(actionId), return QString());
+ //FIXME return action names here if any
+ return QString();
+}
+
+void BareMetalDevice::executeAction(Core::Id actionId, QWidget *parent)
+{
+ QTC_ASSERT(actionIds().contains(actionId), return);
+ Q_UNUSED(parent);
+}
+
+BareMetalDevice::BareMetalDevice(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id)
+ : IDevice(type, origin, machineType, id)
+{
+ setDisplayName(name);
+}
+
+BareMetalDevice::BareMetalDevice(const BareMetalDevice &other)
+ : IDevice(other)
+{
+}
+
+} //namespace Internal
+} //namespace BareMetal
diff --git a/src/plugins/baremetal/baremetaldevice.h b/src/plugins/baremetal/baremetaldevice.h
new file mode 100644
index 0000000000..8b33fa802b
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldevice.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALDEVICE_H
+#define BAREMETALDEVICE_H
+
+#include <projectexplorer/devicesupport/idevice.h>
+#include <QCoreApplication>
+
+namespace BareMetal {
+namespace Internal {
+
+class BareMetalDevice : public ProjectExplorer::IDevice
+{
+ Q_DECLARE_TR_FUNCTIONS(BareMetal::Internal::BareMetalDevice)
+public:
+ typedef QSharedPointer<BareMetalDevice> Ptr;
+ typedef QSharedPointer<const BareMetalDevice> ConstPtr;
+
+ static Ptr create();
+ static Ptr create(const QString &name, Core::Id type, MachineType machineType,
+ Origin origin = ManuallyAdded, Core::Id id = Core::Id());
+
+ QString displayType() const;
+ ProjectExplorer::IDeviceWidget *createWidget();
+ QList<Core::Id> actionIds() const;
+ QString displayNameForActionId(Core::Id actionId) const;
+ void executeAction(Core::Id actionId, QWidget *parent);
+ ProjectExplorer::IDevice::Ptr clone() const;
+
+protected:
+ BareMetalDevice() {}
+ BareMetalDevice(const QString &name, Core::Id type,
+ MachineType machineType, Origin origin, Core::Id id);
+ BareMetalDevice(const BareMetalDevice &other);
+private:
+ BareMetalDevice &operator=(const BareMetalDevice &);
+};
+
+} //namespace Internal
+} //namespace BareMetal
+#endif // BAREMETALDEVICE_H
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationfactory.cpp b/src/plugins/baremetal/baremetaldeviceconfigurationfactory.cpp
new file mode 100644
index 0000000000..c92e861590
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationfactory.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetaldeviceconfigurationfactory.h"
+
+#include "baremetaldeviceconfigurationwizard.h"
+#include "baremetalconstants.h"
+#include "baremetaldevice.h"
+
+#include <utils/qtcassert.h>
+
+using namespace ProjectExplorer;
+
+namespace BareMetal {
+
+BareMetalDeviceConfigurationFactory::BareMetalDeviceConfigurationFactory(QObject *parent)
+ : IDeviceFactory(parent)
+{
+}
+
+QString BareMetalDeviceConfigurationFactory::displayNameForId(Core::Id type) const
+{
+ QTC_ASSERT(type == Constants::BareMetalOsType, return QString());
+ return tr("Bare Metal Device");
+}
+
+QList<Core::Id> BareMetalDeviceConfigurationFactory::availableCreationIds() const
+{
+ return QList<Core::Id>() << Core::Id(Constants::BareMetalOsType);
+}
+
+IDevice::Ptr BareMetalDeviceConfigurationFactory::create(Core::Id id) const
+{
+ QTC_ASSERT(id == Constants::BareMetalOsType, return IDevice::Ptr());
+ BareMetalDeviceConfigurationWizard wizard;
+ if (wizard.exec() != QDialog::Accepted)
+ return IDevice::Ptr();
+ return wizard.device();
+}
+
+bool BareMetalDeviceConfigurationFactory::canRestore(const QVariantMap &map) const
+{
+ return IDevice::typeFromMap(map) == Constants::BareMetalOsType;
+}
+
+IDevice::Ptr BareMetalDeviceConfigurationFactory::restore(const QVariantMap &map) const
+{
+ QTC_ASSERT(canRestore(map), return IDevice::Ptr());
+ const IDevice::Ptr device = Internal::BareMetalDevice::create();
+ device->fromMap(map);
+ return device;
+}
+
+} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationfactory.h b/src/plugins/baremetal/baremetaldeviceconfigurationfactory.h
new file mode 100644
index 0000000000..cc07581450
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationfactory.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALDEVICECONFIGURATIONFACTORY_H
+#define BAREMETALDEVICECONFIGURATIONFACTORY_H
+
+#include <projectexplorer/devicesupport/idevicefactory.h>
+
+namespace BareMetal {
+
+class BareMetalDeviceConfigurationFactory
+ : public ProjectExplorer::IDeviceFactory
+{
+ Q_OBJECT
+
+public:
+ BareMetalDeviceConfigurationFactory(QObject *parent = 0);
+
+ QString displayNameForId(Core::Id type) const;
+ QList<Core::Id> availableCreationIds() const;
+
+ ProjectExplorer::IDevice::Ptr create(Core::Id id) const;
+ bool canRestore(const QVariantMap &map) const;
+ ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const;
+};
+
+} // namespace BareMetal
+#endif // BAREMETALDEVICECONFIGURATIONFACTORY_H
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
new file mode 100644
index 0000000000..80e65754e9
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetaldeviceconfigurationwidget.h"
+
+#include "ui_baremetaldeviceconfigurationwidget.h"
+
+#include <ssh/sshconnection.h>
+#include <QLabel>
+
+using namespace QSsh;
+
+namespace BareMetal {
+
+BareMetalDeviceConfigurationWidget::BareMetalDeviceConfigurationWidget(
+ const ProjectExplorer::IDevice::Ptr &deviceConfig, QWidget *parent) :
+ IDeviceWidget(deviceConfig, parent),
+ m_ui(new Ui::BareMetalDeviceConfigurationWidget)
+{
+ m_ui->setupUi(this);
+ connect(m_ui->gdbHostLineEdit,SIGNAL(editingFinished()),SLOT(hostnameChanged()));
+ connect(m_ui->gdbPortSpinBox,SIGNAL(valueChanged(int)),SLOT(portChanged()));
+ connect(m_ui->gdbCommandsTextEdit,SIGNAL(textChanged()),SLOT(gdbInitCommandsChanged()));
+ initGui();
+}
+
+BareMetalDeviceConfigurationWidget::~BareMetalDeviceConfigurationWidget()
+{
+ delete m_ui;
+}
+
+/* using sshParams fields is ugly but otherwise i would have needed to write my own fromMap
+ * toMap functions */
+
+void BareMetalDeviceConfigurationWidget::hostnameChanged()
+{
+ SshConnectionParameters sshParams = device()->sshParameters();
+ sshParams.host = m_ui->gdbHostLineEdit->text().trimmed();
+ device()->setSshParameters(sshParams);
+}
+
+void BareMetalDeviceConfigurationWidget::portChanged()
+{
+ SshConnectionParameters sshParams = device()->sshParameters();
+ sshParams.port = m_ui->gdbPortSpinBox->value();
+ device()->setSshParameters(sshParams);
+}
+
+void BareMetalDeviceConfigurationWidget::gdbInitCommandsChanged()
+{
+ SshConnectionParameters sshParams = device()->sshParameters();
+ sshParams.userName = m_ui->gdbCommandsTextEdit->toPlainText();
+ device()->setSshParameters(sshParams);
+}
+
+void BareMetalDeviceConfigurationWidget::updateDeviceFromUi() {
+ hostnameChanged();
+ portChanged();
+ gdbInitCommandsChanged();
+}
+
+void BareMetalDeviceConfigurationWidget::initGui()
+{
+ //FIXME reusing SshConnectionParameters is kind of ugly?
+ SshConnectionParameters sshParams = device()->sshParameters();
+ m_ui->gdbHostLineEdit->setText(sshParams.host);
+ m_ui->gdbPortSpinBox->setValue(sshParams.port);
+ m_ui->gdbCommandsTextEdit->setPlainText(sshParams.userName);
+}
+
+} //namespace BareMetal
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.h b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
new file mode 100644
index 0000000000..2953f21c2a
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALDEVICECONFIGURATIONWIDGET_H
+#define BAREMETALDEVICECONFIGURATIONWIDGET_H
+
+#include <projectexplorer/devicesupport/idevicewidget.h>
+
+namespace BareMetal {
+
+namespace Ui {
+class BareMetalDeviceConfigurationWidget;
+}
+
+class BareMetalDeviceConfigurationWidget
+ : public ProjectExplorer::IDeviceWidget
+{
+ Q_OBJECT
+public:
+ explicit BareMetalDeviceConfigurationWidget(
+ const ProjectExplorer::IDevice::Ptr &deviceConfig, QWidget *parent = 0);
+ ~BareMetalDeviceConfigurationWidget();
+private slots:
+ void hostnameChanged();
+ void portChanged();
+ void gdbInitCommandsChanged();
+
+private:
+ void updateDeviceFromUi();
+ void initGui();
+ Ui::BareMetalDeviceConfigurationWidget *m_ui;
+};
+
+} //namespace BareMetal
+#endif // BAREMETALDEVICECONFIGURATIONWIDGET_H
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.ui b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.ui
new file mode 100644
index 0000000000..6abfdb57d8
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.ui
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>BareMetal::BareMetalDeviceConfigurationWidget</class>
+ <widget class="QWidget" name="BareMetal::BareMetalDeviceConfigurationWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>496</width>
+ <height>251</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="gdbHostLabel">
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <property name="text">
+ <string>GDB Host:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="gdbHostLineEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="gdbPortLabel">
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <property name="text">
+ <string>GDB Port:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="gdbPortSpinBox">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>65535</number>
+ </property>
+ <property name="value">
+ <number>3333</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="gdbCommandsLabel">
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <property name="text">
+ <string>GDB commands:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QPlainTextEdit" name="gdbCommandsTextEdit"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp b/src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
new file mode 100644
index 0000000000..0e7da70f96
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetaldeviceconfigurationwizard.h"
+#include "baremetaldeviceconfigurationwizardpages.h"
+#include "baremetaldevice.h"
+#include "baremetalconstants.h"
+#include "ssh/sshconnection.h"
+
+using namespace ProjectExplorer;
+
+namespace BareMetal {
+namespace Internal {
+namespace {
+enum PageId { SetupPageId };
+} // anonymous namespace
+
+
+class BareMetalDeviceConfigrationWizardPrivate
+{
+public:
+ BareMetalDeviceConfigrationWizardPrivate(QWidget *parent):
+ setupPage(parent)
+ {
+ }
+
+ BareMetalDeviceConfigurationWizardSetupPage setupPage;
+};
+} //namespace Internal
+
+BareMetalDeviceConfigurationWizard::BareMetalDeviceConfigurationWizard(QWidget *parent) :
+ QWizard(parent),
+ d(new Internal::BareMetalDeviceConfigrationWizardPrivate(this))
+{
+ setWindowTitle(tr("New Bare Metal Device Configuration Setup"));
+ setPage(Internal::SetupPageId, &d->setupPage);
+ d->setupPage.setCommitPage(true);
+}
+
+BareMetalDeviceConfigurationWizard::~BareMetalDeviceConfigurationWizard()
+{
+ delete d;
+}
+
+IDevice::Ptr BareMetalDeviceConfigurationWizard::device() const
+{
+ //sshParams is not really used as ssh parameters but as debugger parameters
+ QSsh::SshConnectionParameters sshParams;
+ sshParams.host = d->setupPage.gdbHostname();
+ sshParams.port = d->setupPage.gdbPort();
+ sshParams.userName = d->setupPage.gdbInitCommands();
+ IDevice::Ptr device = Internal::BareMetalDevice::create(d->setupPage.configurationName(),
+ Core::Id(Constants::BareMetalOsType),
+ IDevice::Hardware);
+ device->setSshParameters(sshParams);
+ return device;
+}
+} //namespace BareMetal
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizard.h b/src/plugins/baremetal/baremetaldeviceconfigurationwizard.h
new file mode 100644
index 0000000000..3b63d9fa54
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizard.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALDEVICECONFIGURATIONWIZARD_H
+#define BAREMETALDEVICECONFIGURATIONWIZARD_H
+
+#include <projectexplorer/devicesupport/idevice.h>
+
+#include <QWizard>
+
+namespace BareMetal {
+namespace Internal {
+ class BareMetalDeviceConfigrationWizardPrivate;
+} // namespace Internal
+
+class BareMetalDeviceConfigurationWizard : public QWizard
+{
+ Q_OBJECT
+public:
+ BareMetalDeviceConfigurationWizard(QWidget *parent = 0);
+ ~BareMetalDeviceConfigurationWizard();
+
+ ProjectExplorer::IDevice::Ptr device() const;
+
+private:
+ Internal::BareMetalDeviceConfigrationWizardPrivate * const d;
+
+};
+
+} //namespace BareMetal
+
+#endif // BAREMETALDEVICECONFIGURATIONWIZARD_H
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
new file mode 100644
index 0000000000..84f039c85b
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetaldeviceconfigurationwizardpages.h"
+#include "ui_baremetaldeviceconfigurationwizardsetuppage.h"
+
+#include <projectexplorer/devicesupport/idevice.h>
+
+namespace BareMetal {
+namespace Internal {
+class BareMetalDeviceConfigurationWizardSetupPagePrivate;
+} // namespace Internal
+
+BareMetalDeviceConfigurationWizardSetupPage::BareMetalDeviceConfigurationWizardSetupPage(QWidget *parent) :
+ QWizardPage(parent), d(new Internal::BareMetalDeviceConfigurationWizardSetupPagePrivate)
+{
+ d->ui.setupUi(this);
+ setTitle(tr("Gdbserver/hardware debugger setup"));
+ setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
+ connect(d->ui.hostNameLineEdit,SIGNAL(textChanged(QString)),SIGNAL(completeChanged()));
+ connect(d->ui.nameLineEdit,SIGNAL(textChanged(QString)),SIGNAL(completeChanged()));
+ connect(d->ui.portSpinBox,SIGNAL(valueChanged(int)),SIGNAL(completeChanged()));
+ connect(d->ui.gdbInitCommandsPlainTextEdit,SIGNAL(textChanged()),SIGNAL(completeChanged()));
+}
+
+BareMetalDeviceConfigurationWizardSetupPage::~BareMetalDeviceConfigurationWizardSetupPage()
+{
+ delete d;
+}
+
+void BareMetalDeviceConfigurationWizardSetupPage::initializePage()
+{
+ d->ui.nameLineEdit->setText(defaultConfigurationName());
+
+}
+
+bool BareMetalDeviceConfigurationWizardSetupPage::isComplete() const
+{
+ return !configurationName().isEmpty();
+}
+
+QString BareMetalDeviceConfigurationWizardSetupPage::configurationName() const
+{
+ return d->ui.nameLineEdit->text().trimmed();
+}
+
+QString BareMetalDeviceConfigurationWizardSetupPage::gdbHostname() const
+{
+ return d->ui.hostNameLineEdit->text().trimmed();
+}
+
+quint16 BareMetalDeviceConfigurationWizardSetupPage::gdbPort() const
+{
+ return quint16(d->ui.portSpinBox->value());
+}
+
+QString BareMetalDeviceConfigurationWizardSetupPage::gdbInitCommands() const
+{
+ return d->ui.gdbInitCommandsPlainTextEdit->toPlainText();
+}
+
+QString BareMetalDeviceConfigurationWizardSetupPage::defaultConfigurationName() const
+{
+ return tr("Bare Metal Device");
+}
+
+} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
new file mode 100644
index 0000000000..3d35e6ed01
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALDEVICECONFIGURATIONWIZARDPAGES_H
+#define BAREMETALDEVICECONFIGURATIONWIZARDPAGES_H
+
+#include "ui_baremetaldeviceconfigurationwizardsetuppage.h"
+#include <QWizardPage>
+
+namespace BareMetal {
+
+namespace Internal {
+
+class BareMetalDeviceConfigurationWizardSetupPagePrivate
+{
+public:
+ Ui::BareMetalDeviceConfigurationWizardSetupPage ui;
+};
+
+} // namespace Internal
+
+class BareMetalDeviceConfigurationWizardSetupPage : public QWizardPage
+{
+ Q_OBJECT
+public:
+ explicit BareMetalDeviceConfigurationWizardSetupPage(QWidget *parent = 0);
+ ~BareMetalDeviceConfigurationWizardSetupPage();
+
+ void initializePage();
+ bool isComplete() const;
+ QString configurationName() const;
+ QString gdbHostname() const;
+ quint16 gdbPort() const;
+ QString gdbInitCommands() const;
+
+ virtual QString defaultConfigurationName() const;
+private:
+ Internal::BareMetalDeviceConfigurationWizardSetupPagePrivate * const d;
+};
+
+} // namespace BareMetal
+
+#endif // BAREMETALDEVICECONFIGURATIONWIZARDPAGES_H
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizardsetuppage.ui b/src/plugins/baremetal/baremetaldeviceconfigurationwizardsetuppage.ui
new file mode 100644
index 0000000000..9c1e9aa27e
--- /dev/null
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizardsetuppage.ui
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>BareMetal::Internal::BareMetalDeviceConfigurationWizardSetupPage</class>
+ <widget class="QWidget" name="BareMetal::Internal::BareMetalDeviceConfigurationWizardSetupPage">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>517</width>
+ <height>301</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="namelabel">
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="nameLineEdit"/>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="hostNameLineEdit">
+ <property name="text">
+ <string>localhost</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="HostPortLabel">
+ <property name="text">
+ <string>GDB port:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="hostLabel">
+ <property name="text">
+ <string>GDB host:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <widget class="QSpinBox" name="portSpinBox">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>65535</number>
+ </property>
+ <property name="value">
+ <number>3333</number>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0">
+ <widget class="QLabel" name="gdbInitLabel">
+ <property name="text">
+ <string>GDB commands:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1">
+ <widget class="QPlainTextEdit" name="gdbInitCommandsPlainTextEdit"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/baremetal/baremetalgdbcommandsdeploystep.cpp b/src/plugins/baremetal/baremetalgdbcommandsdeploystep.cpp
new file mode 100644
index 0000000000..71ca7c9ef9
--- /dev/null
+++ b/src/plugins/baremetal/baremetalgdbcommandsdeploystep.cpp
@@ -0,0 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetalgdbcommandsdeploystep.h"
+
+using namespace BareMetal::Internal;
+
+namespace BareMetal {
+namespace Internal {
+
+BareMetalGdbCommandsDeployStepWidget::BareMetalGdbCommandsDeployStepWidget(BareMetalGdbCommandsDeployStep &step)
+ : m_step(step)
+{
+ QFormLayout *fl = new QFormLayout(this);
+ fl->setMargin(0);
+ fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
+ setLayout(fl);
+ m_commands = new QPlainTextEdit(this);
+ fl->addRow(tr("GDB commands:"),m_commands);
+ m_commands->setPlainText(m_step.gdbCommands());
+ if (!connect(m_commands,SIGNAL(textChanged()),SLOT(update()))) {
+ qDebug()<<"BareMetalGdbCommandsDeployStepWidget connect failed.";
+ }
+}
+
+void BareMetalGdbCommandsDeployStepWidget::update()
+{
+ m_step.updateGdbCommands(m_commands->toPlainText());
+}
+
+QString BareMetalGdbCommandsDeployStepWidget::displayName() const
+{
+ return QLatin1String("<b>") + m_step.displayName() + QLatin1String("</b>");
+}
+
+QString BareMetalGdbCommandsDeployStepWidget::summaryText() const
+{
+ return displayName();
+}
+
+} // namespace Internal
+
+BareMetalGdbCommandsDeployStep::BareMetalGdbCommandsDeployStep(BuildStepList *bsl,
+ const Core::Id id)
+ : BuildStep(bsl, id)
+{
+ ctor();
+}
+
+BareMetalGdbCommandsDeployStep::BareMetalGdbCommandsDeployStep(BuildStepList *bsl,
+ BareMetalGdbCommandsDeployStep *other)
+ : BuildStep(bsl, other)
+{
+ ctor();
+}
+
+void BareMetalGdbCommandsDeployStep::ctor()
+{
+ setDefaultDisplayName(displayName());
+}
+
+BareMetalGdbCommandsDeployStep::~BareMetalGdbCommandsDeployStep()
+{
+}
+
+void BareMetalGdbCommandsDeployStep::run(QFutureInterface<bool> &fi)
+{
+ fi.reportResult(true);
+ emit finished();
+}
+
+bool BareMetalGdbCommandsDeployStep::fromMap(const QVariantMap &map) {
+ if (!BuildStep::fromMap(map))
+ return false;
+ m_gdbCommands = map.value(QLatin1String(Internal::GdbCommandsKey)).toString();
+ return true;
+}
+
+QVariantMap BareMetalGdbCommandsDeployStep::toMap() const
+{
+ QVariantMap map = BuildStep::toMap();
+ map.insert(QLatin1String(Internal::GdbCommandsKey),m_gdbCommands);
+ return map;
+}
+
+ProjectExplorer::BuildStepConfigWidget *BareMetalGdbCommandsDeployStep::createConfigWidget()
+{
+ return new Internal::BareMetalGdbCommandsDeployStepWidget(*this);
+}
+
+Core::Id BareMetalGdbCommandsDeployStep::stepId()
+{
+ return Core::Id("BareMetal.GdbCommandsDeployStep");
+}
+
+QString BareMetalGdbCommandsDeployStep::displayName()
+{
+ return tr("GDB commands");
+}
+
+void BareMetalGdbCommandsDeployStep::updateGdbCommands(const QString &newCommands)
+{
+ m_gdbCommands = newCommands;
+}
+
+QString BareMetalGdbCommandsDeployStep::gdbCommands() const
+{
+ return m_gdbCommands;
+}
+
+bool BareMetalGdbCommandsDeployStep::init()
+{
+ return true;
+}
+
+} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetalgdbcommandsdeploystep.h b/src/plugins/baremetal/baremetalgdbcommandsdeploystep.h
new file mode 100644
index 0000000000..8c7184413b
--- /dev/null
+++ b/src/plugins/baremetal/baremetalgdbcommandsdeploystep.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALGDBCOMMANDSDEPLOYSTEP_H
+#define BAREMETALGDBCOMMANDSDEPLOYSTEP_H
+
+#include <projectexplorer/buildstep.h>
+
+#include <QVariantMap>
+#include <QFormLayout>
+#include <QPlainTextEdit>
+
+
+using namespace ProjectExplorer;
+namespace BareMetal {
+
+class BareMetalGdbCommandsDeployStep : public ProjectExplorer::BuildStep
+{
+ Q_OBJECT
+public:
+ BareMetalGdbCommandsDeployStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
+ BareMetalGdbCommandsDeployStep(ProjectExplorer::BuildStepList *bsl,
+ BareMetalGdbCommandsDeployStep *other);
+ ~BareMetalGdbCommandsDeployStep();
+
+ bool init();
+ void run(QFutureInterface<bool> &fi);
+ bool runInGuiThread() const { return true;}
+
+ bool fromMap(const QVariantMap &map);
+ QVariantMap toMap() const;
+
+ ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
+
+ static Core::Id stepId();
+ static QString displayName();
+
+ void updateGdbCommands(const QString &newCommands);
+ QString gdbCommands() const;
+private:
+ void ctor();
+ QString m_gdbCommands;
+};
+
+namespace Internal {
+const char GdbCommandsKey[] = "BareMetal.GdbCommandsStep.Commands";
+
+class BareMetalGdbCommandsDeployStepWidget: public ProjectExplorer::BuildStepConfigWidget
+{
+ Q_OBJECT
+public:
+ explicit BareMetalGdbCommandsDeployStepWidget(BareMetal::BareMetalGdbCommandsDeployStep &step);
+public slots:
+ void update();
+private:
+ QString displayName() const;
+ QString summaryText() const;
+ BareMetal::BareMetalGdbCommandsDeployStep &m_step;
+ QPlainTextEdit *m_commands;
+};
+
+} // Internal namespace
+
+} // namespace BareMetal
+#endif // BAREMETALGDBCOMMANDSDEPLOYSTEP_H
diff --git a/src/plugins/baremetal/baremetalplugin.cpp b/src/plugins/baremetal/baremetalplugin.cpp
new file mode 100644
index 0000000000..2eea1e099e
--- /dev/null
+++ b/src/plugins/baremetal/baremetalplugin.cpp
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetalplugin.h"
+#include "baremetalconstants.h"
+#include "baremetaldeviceconfigurationfactory.h"
+#include "baremetalruncontrolfactory.h"
+#include "baremetalrunconfigurationfactory.h"
+#include "baremetaldeployconfigurationfactory.h"
+#include "baremetaldeploystepfactory.h"
+
+#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>
+
+#include <QAction>
+#include <QMessageBox>
+#include <QMainWindow>
+#include <QMenu>
+#include <QtPlugin>
+
+namespace BareMetal {
+namespace Internal {
+
+BareMetalPlugin::BareMetalPlugin()
+{
+ // Create your members
+ setObjectName(QLatin1String("BareMetalPlugin"));
+}
+
+BareMetalPlugin::~BareMetalPlugin()
+{
+ // Unregister objects from the plugin manager's object pool
+ // Delete members
+}
+
+bool BareMetalPlugin::initialize(const QStringList &arguments, QString *errorString)
+{
+ // Register objects in the plugin manager's object pool
+ // Load settings
+ // Add actions to menus
+ // Connect to other plugins' signals
+ // In the initialize method, a plugin can be sure that the plugins it
+ // depends on have initialized their members.
+
+ Q_UNUSED(arguments)
+ Q_UNUSED(errorString)
+
+ addAutoReleasedObject(new BareMetalDeviceConfigurationFactory);
+ addAutoReleasedObject(new BareMetalRunControlFactory);
+ addAutoReleasedObject(new BareMetalRunConfigurationFactory);
+ addAutoReleasedObject(new BareMetalDeployConfigurationFactory);
+ //addAutoReleasedObject(new BareMetalDeployStepFactory);
+
+ /*
+ QAction *action = new QAction(tr("BareMetal action"), this);
+ Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID,
+ Core::Context(Core::Constants::C_GLOBAL));
+ cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A")));
+ connect(action, SIGNAL(triggered()), this, SLOT(triggerAction()));
+
+ Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID);
+ menu->menu()->setTitle(tr("BareMetal"));
+ menu->addAction(cmd);
+ Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
+ */
+
+ return true;
+}
+
+void BareMetalPlugin::extensionsInitialized()
+{
+ // Retrieve objects from the plugin manager's object pool
+ // In the extensionsInitialized method, a plugin can be sure that all
+ // plugins that depend on it are completely initialized.
+}
+
+/*
+ExtensionSystem::IPlugin::ShutdownFlag BareMetalPlugin::aboutToShutdown()
+{
+ // Save settings
+ // Disconnect from signals that are not needed during shutdown
+ // Hide UI (if you add UI that is not in the main window directly)
+ return SynchronousShutdown;
+}
+
+void BareMetalPlugin::triggerAction()
+{
+ QMessageBox::information(Core::ICore::mainWindow(),
+ tr("Action triggered"),
+ tr("This is an action from BareMetal."));
+}
+*/
+
+} // namespace Internal
+} // namespace BareMetal
+
+Q_EXPORT_PLUGIN(BareMetal::Internal::BareMetalPlugin)
+
diff --git a/src/plugins/baremetal/baremetalplugin.h b/src/plugins/baremetal/baremetalplugin.h
new file mode 100644
index 0000000000..90c6fd8ae0
--- /dev/null
+++ b/src/plugins/baremetal/baremetalplugin.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETAL_H
+#define BAREMETAL_H
+
+#include <extensionsystem/iplugin.h>
+
+namespace BareMetal {
+namespace Internal {
+
+class BareMetalPlugin : public ExtensionSystem::IPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "BareMetal.json")
+
+public:
+ BareMetalPlugin();
+ ~BareMetalPlugin();
+
+ bool initialize(const QStringList &arguments, QString *errorString);
+ void extensionsInitialized();
+ //ShutdownFlag aboutToShutdown();
+
+ /*
+private slots:
+ void triggerAction();
+ */
+};
+
+} // namespace Internal
+} // namespace BareMetal
+
+#endif // BAREMETAL_H
+
diff --git a/src/plugins/baremetal/baremetalrunconfiguration.cpp b/src/plugins/baremetal/baremetalrunconfiguration.cpp
new file mode 100644
index 0000000000..a6bd410c62
--- /dev/null
+++ b/src/plugins/baremetal/baremetalrunconfiguration.cpp
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetalrunconfiguration.h"
+
+//#include "baremetalenvironmentaspect.h"
+#include "baremetalrunconfigurationwidget.h"
+
+#include <debugger/debuggerrunconfigurationaspect.h>
+#include <projectexplorer/buildtargetinfo.h>
+#include <projectexplorer/deploymentdata.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/target.h>
+#include <qtsupport/qtoutputformatter.h>
+
+using namespace ProjectExplorer;
+using namespace Utils;
+
+namespace BareMetal {
+namespace Internal {
+
+const char ArgumentsKey[] = "Qt4ProjectManager.MaemoRunConfiguration.Arguments";
+const char ProFileKey[] = "Qt4ProjectManager.MaemoRunConfiguration.ProFile";
+const char WorkingDirectoryKey[] = "BareMetal.RunConfig.WorkingDirectory";
+
+class BareMetalRunConfigurationPrivate
+{
+public:
+ BareMetalRunConfigurationPrivate(const QString &projectFilePath)
+ : projectFilePath(projectFilePath)
+ {
+ }
+
+ BareMetalRunConfigurationPrivate(const BareMetalRunConfigurationPrivate *other)
+ : projectFilePath(other->projectFilePath),
+ gdbPath(other->gdbPath),
+ arguments(other->arguments),
+ workingDirectory(other->workingDirectory)
+ {
+ }
+
+ QString projectFilePath;
+ QString gdbPath;
+ QString arguments;
+ QString disabledReason;
+ QString workingDirectory;
+};
+
+} // namespace Internal
+
+using namespace Internal;
+
+BareMetalRunConfiguration::BareMetalRunConfiguration(Target *parent, BareMetalRunConfiguration *source)
+ : RunConfiguration(parent, source),
+ d(new BareMetalRunConfigurationPrivate(source->d))
+{
+ init();
+}
+
+BareMetalRunConfiguration::BareMetalRunConfiguration(Target *parent,
+ const Core::Id id,
+ const QString &projectFilePath)
+ : RunConfiguration(parent,id),
+ d(new BareMetalRunConfigurationPrivate(projectFilePath))
+{
+ init();
+}
+
+BareMetalRunConfiguration::~BareMetalRunConfiguration()
+{
+ delete d;
+}
+
+void BareMetalRunConfiguration::init()
+{
+ setDefaultDisplayName(defaultDisplayName());
+
+ //FIXME needed? addExtraAspect(new BareMetalEnvironmentAspect(this));
+
+ connect(target(), SIGNAL(deploymentDataChanged()), SLOT(handleBuildSystemDataUpdated()));
+ connect(target(), SIGNAL(applicationTargetsChanged()), SLOT(handleBuildSystemDataUpdated()));
+ connect(target(), SIGNAL(kitChanged()),
+ this, SLOT(handleBuildSystemDataUpdated())); // Handles device changes, etc.
+}
+
+bool BareMetalRunConfiguration::isEnabled() const
+{
+ d->disabledReason.clear();
+ return true;
+}
+
+QString BareMetalRunConfiguration::disabledReason() const
+{
+ return d->disabledReason;
+}
+
+QWidget *BareMetalRunConfiguration::createConfigurationWidget()
+{
+ return new BareMetalRunConfigurationWidget(this);
+}
+
+OutputFormatter *BareMetalRunConfiguration::createOutputFormatter() const
+{
+ return new QtSupport::QtOutputFormatter(target()->project());
+}
+
+QVariantMap BareMetalRunConfiguration::toMap() const
+{
+ QVariantMap map(RunConfiguration::toMap());
+ map.insert(QLatin1String(ArgumentsKey), d->arguments);
+ const QDir dir = QDir(target()->project()->projectDirectory());
+ map.insert(QLatin1String(ProFileKey), dir.relativeFilePath(d->projectFilePath));
+ map.insert(QLatin1String(WorkingDirectoryKey), d->workingDirectory);
+ return map;
+}
+
+bool BareMetalRunConfiguration::fromMap(const QVariantMap &map)
+{
+ if (!RunConfiguration::fromMap(map))
+ return false;
+
+ d->arguments = map.value(QLatin1String(ArgumentsKey)).toString();
+ const QDir dir = QDir(target()->project()->projectDirectory());
+ d->projectFilePath
+ = QDir::cleanPath(dir.filePath(map.value(QLatin1String(ProFileKey)).toString()));
+ d->workingDirectory = map.value(QLatin1String(WorkingDirectoryKey)).toString();
+
+ setDefaultDisplayName(defaultDisplayName());
+
+ return true;
+}
+
+QString BareMetalRunConfiguration::defaultDisplayName()
+{
+ if (!d->projectFilePath.isEmpty())
+ //: %1 is the name of the project run via hardware debugger
+ return tr("%1 (via gdbserver/hardware debugger)").arg(QFileInfo(d->projectFilePath).completeBaseName());
+ //: Bare Metal run configuration default run name
+ return tr("Run on gdbserver/hardware debugger");
+}
+
+QString BareMetalRunConfiguration::localExecutableFilePath() const
+{
+ return target()->applicationTargets()
+ .targetForProject(Utils::FileName::fromString(d->projectFilePath)).toString();
+}
+
+QString BareMetalRunConfiguration::arguments() const
+{
+ return d->arguments;
+}
+
+void BareMetalRunConfiguration::setArguments(const QString &args)
+{
+ d->arguments = args;
+}
+
+QString BareMetalRunConfiguration::workingDirectory() const
+{
+ return d->workingDirectory;
+}
+
+void BareMetalRunConfiguration::setWorkingDirectory(const QString &wd)
+{
+ d->workingDirectory = wd;
+}
+
+QString BareMetalRunConfiguration::projectFilePath() const
+{
+ return d->projectFilePath;
+}
+
+void BareMetalRunConfiguration::setDisabledReason(const QString &reason) const
+{
+ d->disabledReason = reason;
+}
+
+void BareMetalRunConfiguration::handleBuildSystemDataUpdated()
+{
+ emit targetInformationChanged();
+ updateEnableState();
+}
+
+const char *BareMetalRunConfiguration::IdPrefix = "BareMetalRunConfiguration";
+
+} // namespace BareMetal
+
diff --git a/src/plugins/baremetal/baremetalrunconfiguration.h b/src/plugins/baremetal/baremetalrunconfiguration.h
new file mode 100644
index 0000000000..f11dafde22
--- /dev/null
+++ b/src/plugins/baremetal/baremetalrunconfiguration.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALRUNCONFIGURATION_H
+#define BAREMETALRUNCONFIGURATION_H
+
+#include <projectexplorer/runconfiguration.h>
+
+namespace Utils { class PortList; }
+
+namespace BareMetal {
+class BareMetalRunConfigurationWidget;
+class BareMetalDeployConfiguration;
+namespace Internal {
+class BareMetalRunConfigurationPrivate;
+class BareMetalRunConfigurationFactory;
+} // namespace Internal
+class BareMetalRunConfiguration : public ProjectExplorer::RunConfiguration
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(BareMetalRunConfiguration)
+ friend class Internal::BareMetalRunConfigurationFactory;
+ friend class BareMetalRunConfigurationWidget;
+
+public:
+ explicit BareMetalRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id,
+ const QString &projectFilePath);
+ ~BareMetalRunConfiguration();
+
+ bool isEnabled() const;
+ QString disabledReason() const;
+ QWidget *createConfigurationWidget();
+ Utils::OutputFormatter *createOutputFormatter() const;
+
+ QString localExecutableFilePath() const;
+ QString arguments() const;
+ void setArguments(const QString &args);
+ QString workingDirectory() const;
+ void setWorkingDirectory(const QString &wd);
+
+ QVariantMap toMap() const;
+
+ QString projectFilePath() const;
+
+ static const char *IdPrefix;
+signals:
+ void deploySpecsChanged();
+ void targetInformationChanged() const;
+
+protected:
+ BareMetalRunConfiguration(ProjectExplorer::Target *parent, BareMetalRunConfiguration *source);
+ bool fromMap(const QVariantMap &map);
+ QString defaultDisplayName();
+ void setDisabledReason(const QString &reason) const;
+
+protected slots:
+ void updateEnableState() { emit enabledChanged(); }
+
+private slots:
+ void handleBuildSystemDataUpdated();
+
+private:
+ void init();
+
+ Internal::BareMetalRunConfigurationPrivate * const d;
+};
+
+} // namespace BareMetal
+#endif // BAREMETALRUNCONFIGURATION_H
diff --git a/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp b/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp
new file mode 100644
index 0000000000..96700490d6
--- /dev/null
+++ b/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetalrunconfigurationfactory.h"
+#include "baremetalconstants.h"
+#include "baremetalrunconfiguration.h"
+
+#include <projectexplorer/buildtargetinfo.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/target.h>
+#include <utils/qtcassert.h>
+
+#include <QFileInfo>
+#include <QString>
+
+using namespace ProjectExplorer;
+
+namespace BareMetal {
+namespace Internal {
+
+static QString pathFromId(Core::Id id)
+{
+ QByteArray idStr = id.name();
+ if (!idStr.startsWith(BareMetalRunConfiguration::IdPrefix))
+ return QString();
+ return QString::fromUtf8(idStr.mid(strlen(BareMetalRunConfiguration::IdPrefix)));
+}
+
+BareMetalRunConfigurationFactory::BareMetalRunConfigurationFactory(QObject *parent) :
+ ProjectExplorer::IRunConfigurationFactory(parent)
+{
+ setObjectName(QLatin1String("BareMetalRunConfigurationFactory"));
+}
+
+BareMetalRunConfigurationFactory::~BareMetalRunConfigurationFactory()
+{
+}
+
+bool BareMetalRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
+{
+ if (!canHandle(parent))
+ return false;
+ return !parent->applicationTargets().targetForProject(pathFromId(id)).isEmpty();
+}
+
+bool BareMetalRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
+{
+ if (!canHandle(parent))
+ return false;
+ return idFromMap(map).name().startsWith(BareMetalRunConfiguration::IdPrefix);
+}
+
+bool BareMetalRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
+{
+ const BareMetalRunConfiguration * const bmrc
+ = qobject_cast<BareMetalRunConfiguration *>(source);
+ return bmrc && canCreate(parent, source->id());
+}
+
+QList<Core::Id> BareMetalRunConfigurationFactory::availableCreationIds(Target *parent) const
+{
+ QList<Core::Id> result;
+ if (!canHandle(parent))
+ return result;
+
+ const Core::Id base = Core::Id(BareMetalRunConfiguration::IdPrefix);
+ foreach (const BuildTargetInfo &bti, parent->applicationTargets().list)
+ result << base.withSuffix(bti.projectFilePath.toString());
+ return result;
+}
+
+QString BareMetalRunConfigurationFactory::displayNameForId(const Core::Id id) const
+{
+ return tr("%1 (on gdbserver/Hardware Debugger)")
+ .arg(QFileInfo(pathFromId(id)).completeBaseName());
+}
+
+RunConfiguration *BareMetalRunConfigurationFactory::doCreate(Target *parent, const Core::Id id)
+{
+ Q_UNUSED(id);
+ return new BareMetalRunConfiguration(parent, id, pathFromId(id));
+}
+
+RunConfiguration *BareMetalRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
+{
+ Q_UNUSED(map);
+ return doCreate(parent,Core::Id(BareMetalRunConfiguration::IdPrefix));
+}
+
+RunConfiguration *BareMetalRunConfigurationFactory::clone(Target *parent, RunConfiguration *source)
+{
+ QTC_ASSERT(canClone(parent, source), return 0);
+ BareMetalRunConfiguration *old = static_cast<BareMetalRunConfiguration*>(source);
+ return new BareMetalRunConfiguration(parent,old);
+}
+
+bool BareMetalRunConfigurationFactory::canHandle(const Target *target) const
+{
+ if (!target->project()->supportsKit(target->kit()))
+ return false;
+ const Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(target->kit());
+ return deviceType == BareMetal::Constants::BareMetalOsType;
+}
+
+} // namespace Internal
+} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetalrunconfigurationfactory.h b/src/plugins/baremetal/baremetalrunconfigurationfactory.h
new file mode 100644
index 0000000000..ce98c94e47
--- /dev/null
+++ b/src/plugins/baremetal/baremetalrunconfigurationfactory.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALRUNCONFIGURATIONFACTORY_H
+#define BAREMETALRUNCONFIGURATIONFACTORY_H
+
+#include <projectexplorer/runconfiguration.h>
+
+namespace BareMetal {
+namespace Internal {
+class BareMetalRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
+{
+ Q_OBJECT
+public:
+ explicit BareMetalRunConfigurationFactory(QObject *parent = 0);
+ ~BareMetalRunConfigurationFactory();
+
+ QString displayNameForId(const Core::Id id) const;
+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
+
+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
+
+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
+
+ bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
+ ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent,
+ ProjectExplorer::RunConfiguration *source);
+private:
+ bool canHandle(const ProjectExplorer::Target *target) const;
+
+ ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
+ ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
+ const QVariantMap &map);
+};
+
+} // namespace Internal
+} // namespace RemoteLinux
+
+#endif // BAREMETALRUNCONFIGURATIONFACTORY_H
diff --git a/src/plugins/baremetal/baremetalrunconfigurationwidget.cpp b/src/plugins/baremetal/baremetalrunconfigurationwidget.cpp
new file mode 100644
index 0000000000..dcefec29b3
--- /dev/null
+++ b/src/plugins/baremetal/baremetalrunconfigurationwidget.cpp
@@ -0,0 +1,162 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetalrunconfigurationwidget.h"
+#include "baremetalrunconfiguration.h"
+#include <utils/detailswidget.h>
+
+#include <QLineEdit>
+#include <QFormLayout>
+#include <QLabel>
+#include <QCoreApplication>
+#include <QDir>
+
+namespace BareMetal {
+namespace Internal {
+
+class BareMetalRunConfigurationWidgetPrivate
+{
+public:
+ BareMetalRunConfigurationWidgetPrivate(BareMetalRunConfiguration *runConfig)
+ : runConfiguration(runConfig)
+ {
+ }
+
+ BareMetalRunConfiguration * const runConfiguration;
+ QWidget topWidget;
+ QLabel disabledIcon;
+ QLabel disabledReason;
+ QLineEdit argsLineEdit;
+ QLineEdit workingDirLineEdit;
+ QLabel localExecutableLabel;
+ QFormLayout genericWidgetsLayout;
+};
+
+} // namespace Internal
+
+using namespace Internal;
+
+BareMetalRunConfigurationWidget::BareMetalRunConfigurationWidget(BareMetalRunConfiguration *runConfiguration,
+ QWidget *parent)
+ : QWidget(parent),d(new BareMetalRunConfigurationWidgetPrivate(runConfiguration))
+{
+ QVBoxLayout *topLayout = new QVBoxLayout(this);
+ topLayout->setMargin(0);
+ addDisabledLabel(topLayout);
+ topLayout->addWidget(&d->topWidget);
+ QVBoxLayout *mainLayout = new QVBoxLayout(&d->topWidget);
+ mainLayout->setMargin(0);
+ addGenericWidgets(mainLayout);
+
+ connect(d->runConfiguration, SIGNAL(enabledChanged()),SLOT(runConfigurationEnabledChange()));
+ runConfigurationEnabledChange();
+}
+
+BareMetalRunConfigurationWidget::~BareMetalRunConfigurationWidget()
+{
+ delete d;
+}
+
+void BareMetalRunConfigurationWidget::addDisabledLabel(QVBoxLayout *topLayout)
+{
+ QHBoxLayout * const hl = new QHBoxLayout;
+ hl->addStretch();
+ d->disabledIcon.setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
+ hl->addWidget(&d->disabledIcon);
+ d->disabledReason.setVisible(false);
+ hl->addWidget(&d->disabledReason);
+ hl->addStretch();
+ topLayout->addLayout(hl);
+}
+
+void BareMetalRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
+{
+ Utils::DetailsWidget *detailsContainer = new Utils::DetailsWidget(this);
+ detailsContainer->setState(Utils::DetailsWidget::NoSummary);
+
+ QWidget *details = new QWidget(this);
+ details->setLayout(&d->genericWidgetsLayout);
+ detailsContainer->setWidget(details);
+
+ mainLayout->addWidget(detailsContainer);
+
+ d->genericWidgetsLayout.setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
+
+ d->localExecutableLabel.setText(d->runConfiguration->localExecutableFilePath());
+ d->genericWidgetsLayout.addRow(tr("Executable:"),&d->localExecutableLabel);
+
+ //d->genericWidgetsLayout.addRow(tr("Debugger host:"),d->runConfiguration);
+ //d->genericWidgetsLayout.addRow(tr("Debugger port:"),d->runConfiguration);
+ d->argsLineEdit.setText(d->runConfiguration->arguments());
+ d->genericWidgetsLayout.addRow(tr("Arguments:"), &d->argsLineEdit);
+
+ d->workingDirLineEdit.setPlaceholderText(tr("<default>"));
+ d->workingDirLineEdit.setText(d->runConfiguration->workingDirectory());
+ d->genericWidgetsLayout.addRow(tr("Working directory:"), &d->workingDirLineEdit);
+ connect(&d->argsLineEdit, SIGNAL(textEdited(QString)), SLOT(argumentsEdited(QString)));
+ connect(d->runConfiguration, SIGNAL(targetInformationChanged()), this,
+ SLOT(updateTargetInformation()));
+ connect(&d->workingDirLineEdit, SIGNAL(textEdited(QString)),
+ SLOT(handleWorkingDirectoryChanged()));
+}
+
+void BareMetalRunConfigurationWidget::argumentsEdited(const QString &args)
+{
+ d->runConfiguration->setArguments(args);
+}
+
+void BareMetalRunConfigurationWidget::updateTargetInformation()
+{
+ setLabelText(d->localExecutableLabel,
+ QDir::toNativeSeparators(d->runConfiguration->localExecutableFilePath()),
+ tr("Unknown"));
+}
+
+void BareMetalRunConfigurationWidget::handleWorkingDirectoryChanged()
+{
+ d->runConfiguration->setWorkingDirectory(d->workingDirLineEdit.text().trimmed());
+}
+
+void BareMetalRunConfigurationWidget::setLabelText(QLabel &label, const QString &regularText, const QString &errorText)
+{
+ const QString errorMessage = QLatin1String("<font color=\"red\">") + errorText
+ + QLatin1String("</font>");
+ label.setText(regularText.isEmpty() ? errorMessage : regularText);
+}
+
+void BareMetalRunConfigurationWidget::runConfigurationEnabledChange()
+{
+ bool enabled = d->runConfiguration->isEnabled();
+ d->topWidget.setEnabled(enabled);
+ d->disabledIcon.setVisible(!enabled);
+ d->disabledReason.setVisible(!enabled);
+ d->disabledReason.setText(d->runConfiguration->disabledReason());
+}
+
+} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetalrunconfigurationwidget.h b/src/plugins/baremetal/baremetalrunconfigurationwidget.h
new file mode 100644
index 0000000000..9174b9cf95
--- /dev/null
+++ b/src/plugins/baremetal/baremetalrunconfigurationwidget.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALRUNCONFIGURATIONWIDGET_H
+#define BAREMETALRUNCONFIGURATIONWIDGET_H
+
+#include <QWidget>
+
+QT_BEGIN_NAMESPACE
+class QLabel;
+class QVBoxLayout;
+QT_END_NAMESPACE
+
+namespace BareMetal {
+class BareMetalRunConfiguration;
+
+namespace Internal {
+class BareMetalRunConfigurationWidgetPrivate;
+} // namespace Internal
+
+class BareMetalRunConfigurationWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit BareMetalRunConfigurationWidget(BareMetalRunConfiguration *runConfiguration,
+ QWidget *parent = 0);
+ ~BareMetalRunConfigurationWidget();
+ void addDisabledLabel(QVBoxLayout *topLayout);
+
+ Q_SLOT void runConfigurationEnabledChange();
+
+private slots:
+ void argumentsEdited(const QString &args);
+ void updateTargetInformation();
+ void handleWorkingDirectoryChanged();
+
+private:
+ void addGenericWidgets(QVBoxLayout *mainLayout);
+ void setLabelText(QLabel &label, const QString &regularText, const QString &errorText);
+
+ Internal::BareMetalRunConfigurationWidgetPrivate * const d;
+};
+
+} // namespace BareMetal
+#endif // BAREMETALRUNCONFIGURATIONWIDGET_H
diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp
new file mode 100644
index 0000000000..ebc073b947
--- /dev/null
+++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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.
+**
+****************************************************************************/
+
+#include "baremetalruncontrolfactory.h"
+#include "baremetalgdbcommandsdeploystep.h"
+#include "baremetalrunconfiguration.h"
+
+#include <debugger/debuggerplugin.h>
+#include <debugger/debuggerrunner.h>
+#include <debugger/debuggerstartparameters.h>
+#include <debugger/debuggerkitinformation.h>
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/toolchain.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/buildconfiguration.h>
+#include <analyzerbase/analyzerstartparameters.h>
+#include <analyzerbase/analyzermanager.h>
+#include <analyzerbase/analyzerruncontrol.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/target.h>
+#include <utils/portlist.h>
+#include <utils/qtcassert.h>
+
+using namespace Analyzer;
+using namespace Debugger;
+using namespace ProjectExplorer;
+
+namespace BareMetal {
+namespace Internal {
+
+BareMetalRunControlFactory::BareMetalRunControlFactory(QObject *parent) :
+ ProjectExplorer::IRunControlFactory(parent)
+{
+}
+
+BareMetalRunControlFactory::~BareMetalRunControlFactory()
+{
+}
+
+bool BareMetalRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const
+{
+ if (mode != NormalRunMode && mode != DebugRunMode && mode != DebugRunModeWithBreakOnMain
+ && mode != QmlProfilerRunMode) {
+ return false;
+ }
+
+ const QByteArray idStr = runConfiguration->id().name();
+ return runConfiguration->isEnabled() && idStr.startsWith(BareMetalRunConfiguration::IdPrefix);
+}
+
+DebuggerStartParameters BareMetalRunControlFactory::startParameters(const BareMetalRunConfiguration *runConfig)
+{
+ DebuggerStartParameters params;
+ Target *target = runConfig->target();
+ Kit *k = target->kit();
+ const IDevice::ConstPtr device = DeviceKitInformation::device(k);
+ QTC_ASSERT(device, return params);
+ params.sysRoot = SysRootKitInformation::sysRoot(k).toString();
+ params.debuggerCommand = DebuggerKitInformation::debuggerCommand(k).toString();
+ if (ToolChain *tc = ToolChainKitInformation::toolChain(k))
+ params.toolChainAbi = tc->targetAbi();
+ params.languages |= CppLanguage;
+ params.processArgs = runConfig->arguments();
+ params.startMode = AttachToRemoteServer;
+ params.executable = Utils::HostOsInfo::withExecutableSuffix(runConfig->localExecutableFilePath());
+ params.remoteSetupNeeded = false; //FIXME probably start debugserver with that, how?
+ params.displayName = runConfig->displayName();
+ if (const Project *project = target->project()) {
+ params.projectSourceDirectory = project->projectDirectory();
+ if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
+ params.projectBuildDirectory = buildConfig->buildDirectory().toString();
+ params.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
+ }
+ params.remoteChannel = device->sshParameters().host + QLatin1String(":") + QString::number(device->sshParameters().port);
+ params.remoteSetupNeeded = false; // qml stuff, not needed
+ params.commandsAfterConnect = device->sshParameters().userName.toLatin1();
+ BuildConfiguration *bc = target->activeBuildConfiguration();
+ BuildStepList *bsl = bc->stepList(BareMetalGdbCommandsDeployStep::stepId());
+ if (bsl) {
+ foreach (BuildStep *bs,bsl->steps()) {
+ BareMetalGdbCommandsDeployStep *ds = qobject_cast<BareMetalGdbCommandsDeployStep *>(bs);
+ if (ds) {
+ if (!params.commandsAfterConnect.endsWith("\n"))
+ params.commandsAfterConnect.append("\n");
+ params.commandsAfterConnect.append(ds->gdbCommands().toLatin1());
+ }
+ }
+ }
+ params.useContinueInsteadOfRun = true; //we can't execute as its always running
+ return params;
+}
+
+RunControl *BareMetalRunControlFactory::create(RunConfiguration *runConfiguration,
+ RunMode mode,
+ QString *errorMessage)
+{
+ QTC_ASSERT(canRun(runConfiguration, mode), return 0);
+
+ BareMetalRunConfiguration *rc = qobject_cast<BareMetalRunConfiguration *>(runConfiguration);
+ QTC_ASSERT(rc, return 0);
+ IDevice::ConstPtr dev = DeviceKitInformation::device(rc->target()->kit());
+ if (!dev) {
+ *errorMessage = tr("Cannot debug: Kit has no device.");
+ return 0;
+ }
+ DebuggerStartParameters sp = startParameters(rc);
+ return DebuggerPlugin::createDebugger(sp,runConfiguration,errorMessage);
+}
+
+} // namespace Internal
+} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.h b/src/plugins/baremetal/baremetalruncontrolfactory.h
new file mode 100644
index 0000000000..12fc316a00
--- /dev/null
+++ b/src/plugins/baremetal/baremetalruncontrolfactory.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Tim Sander <tim@krieglstein.org>
+** 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
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** 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 BAREMETALRUNCONTROLFACTORY_H
+#define BAREMETALRUNCONTROLFACTORY_H
+#include "baremetalrunconfiguration.h"
+#include <projectexplorer/runconfiguration.h>
+#include <debugger/debuggerstartparameters.h>
+
+namespace BareMetal {
+namespace Internal {
+
+class BareMetalRunControlFactory : public ProjectExplorer::IRunControlFactory
+{
+ Q_OBJECT
+public:
+ explicit BareMetalRunControlFactory(QObject *parent = 0);
+ ~BareMetalRunControlFactory();
+ Debugger::DebuggerStartParameters startParameters(const BareMetalRunConfiguration *runConfig);
+ bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
+ ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode,
+ QString *errorMessage);
+};
+
+} // namespace Internal
+} // namespace BareMetal
+
+#endif // BAREMETALRUNCONTROLFACTORY_H
diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h
index 0f510e18f1..88f5a72e91 100644
--- a/src/plugins/debugger/debuggerstartparameters.h
+++ b/src/plugins/debugger/debuggerstartparameters.h
@@ -68,6 +68,7 @@ public:
qmlServerAddress(QLatin1String("127.0.0.1")),
qmlServerPort(Constants::QML_DEFAULT_DEBUG_SERVER_PORT),
remoteSetupNeeded(false),
+ useContinueInsteadOfRun(false),
startMode(NoStartMode),
closeMode(KillAtClose),
testReceiver(0),
@@ -123,6 +124,10 @@ public:
bool remoteSetupNeeded;
QMap<QString, QString> sourcePathMap;
+ // Used by baremetal plugin
+ bool useContinueInsteadOfRun; // if connected to a hw debugger run is not possible but continue is used
+ QByteArray commandsAfterConnect; // additional commands to post after connection to debug target
+
QString dumperLibrary;
QStringList solibSearchPath;
QStringList dumperLibraryLocations;
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 197b6086cf..27486410f6 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1753,7 +1753,6 @@ void GdbEngine::handleStop2(const GdbMi &data)
reasontr = msgStoppedBySignal(_(meaning), _(name));
}
}
-
if (reason.isEmpty())
showStatusMessage(msgStopped());
else
@@ -5100,6 +5099,12 @@ void GdbEngine::handleInferiorPrepared()
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
+ if (!sp.commandsAfterConnect.isEmpty()) {
+ foreach (QByteArray command, sp.commandsAfterConnect.split('\n')) {
+ postCommand(command);
+ }
+ }
+
if (debuggerCore()->boolSetting(IntelFlavor)) {
//postCommand("set follow-exec-mode new");
postCommand("set disassembly-flavor intel");
diff --git a/src/plugins/debugger/gdb/gdbplainengine.cpp b/src/plugins/debugger/gdb/gdbplainengine.cpp
index d798d74e77..eaa992ec75 100644
--- a/src/plugins/debugger/gdb/gdbplainengine.cpp
+++ b/src/plugins/debugger/gdb/gdbplainengine.cpp
@@ -85,7 +85,10 @@ void GdbPlainEngine::handleFileExecAndSymbols(const GdbResponse &response)
void GdbPlainEngine::runEngine()
{
- postCommand("-exec-run", GdbEngine::RunRequest, CB(handleExecRun));
+ if (startParameters().useContinueInsteadOfRun)
+ postCommand("-exec-continue", GdbEngine::RunRequest, CB(handleExecuteContinue));
+ else
+ postCommand("-exec-run", GdbEngine::RunRequest, CB(handleExecRun));
}
void GdbPlainEngine::handleExecRun(const GdbResponse &response)
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index ffd8fc3068..430e135b40 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -47,7 +47,8 @@ SUBDIRS = \
valgrind \
todo \
qnx \
- clearcase
+ clearcase \
+ baremetal
isEmpty(QBS_INSTALL_DIR): QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR)
exists(../shared/qbs/qbs.pro)|!isEmpty(QBS_INSTALL_DIR): \