From 5dd0e745ee7603b9dfbc02a206bdac1d8a7ba0f9 Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Tue, 26 Nov 2019 16:22:40 +0300 Subject: [PATCH] BareMetal: Get rid of SSH connection parameters ... as we don't use the SSH parameters at all. Tested on the STM32 NUCLEO-F767ZI board with the OpenOCD and the ST-Link providers on Windows host. Change-Id: I1e21112c9058129d14ce584a804777532933a7d9 Reviewed-by: hjk --- src/plugins/baremetal/baremetaldevice.cpp | 12 +----------- src/plugins/baremetal/baremetaldevice.h | 1 - .../debugservers/gdb/gdbserverprovider.cpp | 13 ------------- .../baremetal/debugservers/gdb/gdbserverprovider.h | 1 - src/plugins/baremetal/idebugserverprovider.cpp | 2 -- src/plugins/baremetal/idebugserverprovider.h | 1 - 6 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/plugins/baremetal/baremetaldevice.cpp b/src/plugins/baremetal/baremetaldevice.cpp index 0c1a47e93b6..b27c66455ab 100644 --- a/src/plugins/baremetal/baremetaldevice.cpp +++ b/src/plugins/baremetal/baremetaldevice.cpp @@ -80,10 +80,8 @@ void BareMetalDevice::setDebugServerProviderId(const QString &id) DebugServerProviderManager::findProvider(m_debugServerProviderId)) currentProvider->unregisterDevice(this); m_debugServerProviderId = id; - if (IDebugServerProvider *provider = DebugServerProviderManager::findProvider(id)) { - provider->updateDevice(this); + if (IDebugServerProvider *provider = DebugServerProviderManager::findProvider(id)) provider->registerDevice(this); - } } void BareMetalDevice::unregisterDebugServerProvider(IDebugServerProvider *provider) @@ -92,14 +90,6 @@ void BareMetalDevice::unregisterDebugServerProvider(IDebugServerProvider *provid m_debugServerProviderId.clear(); } -void BareMetalDevice::debugServerProviderUpdated(IDebugServerProvider *provider) -{ - IDebugServerProvider *myProvider = DebugServerProviderManager::findProvider( - m_debugServerProviderId); - if (provider == myProvider) - provider->updateDevice(this); -} - void BareMetalDevice::fromMap(const QVariantMap &map) { IDevice::fromMap(map); diff --git a/src/plugins/baremetal/baremetaldevice.h b/src/plugins/baremetal/baremetaldevice.h index 74e32b3605a..28299e8d315 100644 --- a/src/plugins/baremetal/baremetaldevice.h +++ b/src/plugins/baremetal/baremetaldevice.h @@ -54,7 +54,6 @@ public: QString debugServerProviderId() const; void setDebugServerProviderId(const QString &id); void unregisterDebugServerProvider(IDebugServerProvider *provider); - void debugServerProviderUpdated(IDebugServerProvider *provider); void fromMap(const QVariantMap &map) final; QVariantMap toMap() const final; diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index 7596820a965..d53fb42e8fa 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -221,19 +221,6 @@ RunWorker *GdbServerProvider::targetRunner(RunControl *runControl) const return new GdbServerProviderRunner(runControl, r); } -void GdbServerProvider::updateDevice(ProjectExplorer::IDevice *dev) const -{ - QTC_ASSERT(dev, return); - const QString channel = channelString(); - const int colon = channel.indexOf(':'); - if (colon < 0) - return; - QSsh::SshConnectionParameters sshParams = dev->sshParameters(); - sshParams.setHost(channel.left(colon)); - sshParams.setPort(channel.midRef(colon + 1).toUShort()); - dev->setSshParameters(sshParams); -} - bool GdbServerProvider::canStartupMode(StartupMode m) const { return m == NoStartup; diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h index 71ffab85985..fbfadeff0e6 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.h @@ -68,7 +68,6 @@ public: QString &errorMessage) const final; ProjectExplorer::RunWorker *targetRunner( ProjectExplorer::RunControl *runControl) const final; - void updateDevice(ProjectExplorer::IDevice *dev) const final; bool isValid() const override; virtual bool canStartupMode(StartupMode) const; diff --git a/src/plugins/baremetal/idebugserverprovider.cpp b/src/plugins/baremetal/idebugserverprovider.cpp index ab2f023eaba..7b7493dd3fe 100644 --- a/src/plugins/baremetal/idebugserverprovider.cpp +++ b/src/plugins/baremetal/idebugserverprovider.cpp @@ -151,8 +151,6 @@ void IDebugServerProvider::unregisterDevice(BareMetalDevice *device) void IDebugServerProvider::providerUpdated() { DebugServerProviderManager::notifyAboutUpdate(this); - for (BareMetalDevice *device : qAsConst(m_devices)) - device->debugServerProviderUpdated(this); } bool IDebugServerProvider::fromMap(const QVariantMap &data) diff --git a/src/plugins/baremetal/idebugserverprovider.h b/src/plugins/baremetal/idebugserverprovider.h index dac8530a626..eb0cc28f1ae 100644 --- a/src/plugins/baremetal/idebugserverprovider.h +++ b/src/plugins/baremetal/idebugserverprovider.h @@ -82,7 +82,6 @@ public: QString &errorMessage) const = 0; virtual ProjectExplorer::RunWorker *targetRunner( ProjectExplorer::RunControl *runControl) const = 0; - virtual void updateDevice(ProjectExplorer::IDevice *dev) const = 0; virtual bool isValid() const = 0;