summaryrefslogtreecommitdiff
path: root/src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-11-04 00:51:58 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-11-04 10:55:46 +0000
commit4828aa724414295ea59ef0a319ec634324c633c5 (patch)
treeba2841639283cc99d659c7c7e013ed08b024c870 /src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
parent04bd6e39c8991fcb89ab15728f622a5a3ae8f0b2 (diff)
downloadqt-creator-4828aa724414295ea59ef0a319ec634324c633c5.tar.gz
BareMetal: Minimize dependency from GDB engine
The problem is that this plugin was originally developed only for working with the GDB debugging engine. This hard dependency penetrates to all plugin logic, that excludes an easy addition of other types of a debugger engines. This patch tries to minimize the GDB dependency and improves code a bit in the following way: * A code that belongs to the GDB engine moved to the separate debugservers/gdb directory. * A classes having a common functionality are renamed with 'Debug' suffixes instead of 'Gdb' suffixes. * Introduced a new interface IDebugServerProvider{Factory|ConfigWidget} whih are used as a base for all derived debug servers providers (e.g. for the OpenOCD, STLink and etc). * The IDebugServerProvider interface has a new virtual engineType() method to show a supported debugger engine by a specific debugger server provider. This method is used in BareMetalDebugSupport class to detect a provider engine for an additional initialization (which depends on an used debugger engine). * The IDebugServerProvider interface has a new virtual hasProcess() method. E.g. this is required for a future debug server providers which has not a remote processes. In this case the BareMetalDevice::canCreateProcess() will report about that in a right way. Thus, this approach allowed us to preserve a previous behavior of an already implemented GDB providers. Also it makes possible to add a new providers in a future with a minimized costs. Change-Id: I1be84b9178d4aa78c3ef5108a9e6b381e245f36f Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp')
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
index 26257ef128..b1288aa1fa 100644
--- a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
@@ -27,8 +27,8 @@
#include "baremetaldevice.h"
#include "baremetaldeviceconfigurationwidget.h"
-#include "gdbserverprovider.h"
-#include "gdbserverproviderchooser.h"
+#include "debugserverproviderchooser.h"
+#include "idebugserverprovider.h"
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
@@ -50,13 +50,13 @@ BareMetalDeviceConfigurationWidget::BareMetalDeviceConfigurationWidget(
const auto formLayout = new QFormLayout(this);
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
- m_gdbServerProviderChooser = new GdbServerProviderChooser(true, this);
- m_gdbServerProviderChooser->populate();
- m_gdbServerProviderChooser->setCurrentProviderId(dev->gdbServerProviderId());
- formLayout->addRow(tr("GDB server provider:"), m_gdbServerProviderChooser);
+ m_debugServerProviderChooser = new DebugServerProviderChooser(true, this);
+ m_debugServerProviderChooser->populate();
+ m_debugServerProviderChooser->setCurrentProviderId(dev->debugServerProviderId());
+ formLayout->addRow(tr("Debug server provider:"), m_debugServerProviderChooser);
- connect(m_gdbServerProviderChooser, &GdbServerProviderChooser::providerChanged,
- this, &BareMetalDeviceConfigurationWidget::gdbServerProviderChanged);
+ connect(m_debugServerProviderChooser, &DebugServerProviderChooser::providerChanged,
+ this, &BareMetalDeviceConfigurationWidget::debugServerProviderChanged);
m_peripheralDescriptionFileChooser = new Utils::PathChooser(this);
m_peripheralDescriptionFileChooser->setExpectedKind(Utils::PathChooser::File);
@@ -72,11 +72,11 @@ BareMetalDeviceConfigurationWidget::BareMetalDeviceConfigurationWidget(
this, &BareMetalDeviceConfigurationWidget::peripheralDescriptionFileChanged);
}
-void BareMetalDeviceConfigurationWidget::gdbServerProviderChanged()
+void BareMetalDeviceConfigurationWidget::debugServerProviderChanged()
{
const auto dev = qSharedPointerCast<BareMetalDevice>(device());
QTC_ASSERT(dev, return);
- dev->setGdbServerProviderId(m_gdbServerProviderChooser->currentProviderId());
+ dev->setDebugServerProviderId(m_debugServerProviderChooser->currentProviderId());
}
void BareMetalDeviceConfigurationWidget::peripheralDescriptionFileChanged()
@@ -88,7 +88,7 @@ void BareMetalDeviceConfigurationWidget::peripheralDescriptionFileChanged()
void BareMetalDeviceConfigurationWidget::updateDeviceFromUi()
{
- gdbServerProviderChanged();
+ debugServerProviderChanged();
}
} // namespace Internal