BareMetal: Don't create default GDB server provider

... if a BareMetalDevice doesn't have any configured
provider yet.

Reason is that a 'Default GDB' provider does not means
that it is default. It just means, that this provider
can be attached to the remote running GDB server (it is
equivalent of "Attach to Running Debug Server").

Besides, in future, it is makes sense to remove this
provider at all as it is useless.

Change-Id: I2c5c59595dc7d724ac6e05177bbc6ae85cf67e2e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Denis Shienkov
2019-11-18 19:19:40 +03:00
parent cab228d05a
commit 9073c46c9c

View File

@@ -29,13 +29,10 @@
#include "baremetaldeviceconfigurationwidget.h" #include "baremetaldeviceconfigurationwidget.h"
#include "baremetaldeviceconfigurationwizard.h" #include "baremetaldeviceconfigurationwizard.h"
#include "debugserverprovidermanager.h" #include "debugserverprovidermanager.h"
#include "idebugserverprovider.h"
// TODO: Remove mention about GDB server providers from this file!
#include "debugservers/gdb/defaultgdbserverprovider.h"
#include <coreplugin/id.h> #include <coreplugin/id.h>
#include <ssh/sshconnection.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QCoreApplication> #include <QCoreApplication>
@@ -112,19 +109,12 @@ void BareMetalDevice::fromMap(const QVariantMap &map)
if (IDebugServerProvider *provider = if (IDebugServerProvider *provider =
DebugServerProviderManager::findByDisplayName(name)) { DebugServerProviderManager::findByDisplayName(name)) {
providerId = provider->id(); providerId = provider->id();
} else {
const QSsh::SshConnectionParameters sshParams = sshParameters();
const auto newProvider = new DefaultGdbServerProvider;
newProvider->setChannel(sshParams.url);
newProvider->setDisplayName(name);
if (DebugServerProviderManager::registerProvider(newProvider))
providerId = newProvider->id();
else
delete newProvider;
}
}
setDebugServerProviderId(providerId); setDebugServerProviderId(providerId);
} }
} else {
setDebugServerProviderId(providerId);
}
}
QVariantMap BareMetalDevice::toMap() const QVariantMap BareMetalDevice::toMap() const
{ {