diff options
author | hjk <hjk@theqtcompany.com> | 2016-02-02 14:32:36 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-04-08 07:00:21 +0000 |
commit | 62c6a07445414218ec4b8776893c084c08596cc8 (patch) | |
tree | d41cf65051a9d72baf5778a4b25202b6b8df373f /src | |
parent | 916b92228ab7d5d1510bbc868acfc6d1db667d85 (diff) | |
download | qt-creator-62c6a07445414218ec4b8776893c084c08596cc8.tar.gz |
BareMetal: Simplify RunControl setup
The device is now accessible through the run control pointer, no
need to pass it around explicitly.
Change-Id: Ife27aaae83679b235b4b066fc54baada2eae01a4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/baremetal/baremetaldebugsupport.cpp | 9 | ||||
-rw-r--r-- | src/plugins/baremetal/baremetaldebugsupport.h | 14 | ||||
-rw-r--r-- | src/plugins/baremetal/baremetalruncontrolfactory.cpp | 3 |
3 files changed, 6 insertions, 20 deletions
diff --git a/src/plugins/baremetal/baremetaldebugsupport.cpp b/src/plugins/baremetal/baremetaldebugsupport.cpp index 56f6b1e226..3bbf232311 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.cpp +++ b/src/plugins/baremetal/baremetaldebugsupport.cpp @@ -43,13 +43,10 @@ using namespace ProjectExplorer; namespace BareMetal { namespace Internal { -BareMetalDebugSupport::BareMetalDebugSupport( - const ProjectExplorer::IDevice::ConstPtr device, - Debugger::DebuggerRunControl *runControl) +BareMetalDebugSupport::BareMetalDebugSupport(Debugger::DebuggerRunControl *runControl) : QObject(runControl) , m_appRunner(new ProjectExplorer::DeviceApplicationRunner(this)) , m_runControl(runControl) - , m_device(device) , m_state(BareMetalDebugSupport::Inactive) { Q_ASSERT(runControl); @@ -149,7 +146,7 @@ void BareMetalDebugSupport::adapterSetupFailed(const QString &error) void BareMetalDebugSupport::startExecution() { - auto dev = qSharedPointerCast<const BareMetalDevice>(m_device); + auto dev = qSharedPointerCast<const BareMetalDevice>(m_runControl->device()); QTC_ASSERT(dev, return); const GdbServerProvider *p = GdbServerProviderManager::instance()->findProvider( @@ -175,7 +172,7 @@ void BareMetalDebugSupport::startExecution() StandardRunnable r; r.executable = p->executable(); r.commandLineArguments = Utils::QtcProcess::joinArgs(p->arguments(), Utils::OsTypeLinux); - m_appRunner->start(m_device, r); + m_appRunner->start(dev, r); } void BareMetalDebugSupport::setFinished() diff --git a/src/plugins/baremetal/baremetaldebugsupport.h b/src/plugins/baremetal/baremetaldebugsupport.h index 5130a62a65..31aa1b5935 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.h +++ b/src/plugins/baremetal/baremetaldebugsupport.h @@ -28,28 +28,19 @@ #include <QObject> #include <QPointer> -#include <projectexplorer/devicesupport/idevice.h> - namespace Debugger { class DebuggerRunControl; } -namespace ProjectExplorer { -class DeviceApplicationRunner; -class IDevice; -} +namespace ProjectExplorer { class DeviceApplicationRunner; } namespace BareMetal { namespace Internal { -class GdbServerProvider; -class BareMetalRunConfiguration; - class BareMetalDebugSupport : public QObject { Q_OBJECT public: - explicit BareMetalDebugSupport(const ProjectExplorer::IDevice::ConstPtr device, - Debugger::DebuggerRunControl *runControl); + explicit BareMetalDebugSupport(Debugger::DebuggerRunControl *runControl); ~BareMetalDebugSupport(); private slots: @@ -75,7 +66,6 @@ private: ProjectExplorer::DeviceApplicationRunner *m_appRunner; const QPointer<Debugger::DebuggerRunControl> m_runControl; - const ProjectExplorer::IDevice::ConstPtr m_device; BareMetalDebugSupport::State m_state; }; diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp index b9b49286db..ffedd81915 100644 --- a/src/plugins/baremetal/baremetalruncontrolfactory.cpp +++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp @@ -137,8 +137,7 @@ RunControl *BareMetalRunControlFactory::create( DebuggerRunControl *runControl = createDebuggerRunControl(sp, rc, errorMessage, mode); if (runControl && sp.remoteSetupNeeded) { - const auto debugSupport = new BareMetalDebugSupport(dev, runControl); - Q_UNUSED(debugSupport); + (void) BareMetalDebugSupport(runControl); } return runControl; |