diff --git a/CMakeLists.txt b/CMakeLists.txt index c4bd5b5a..051570e6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,7 @@ target_compile_options( PUBLIC -Wpessimizing-move PUBLIC -Wredundant-move PUBLIC -Wsuggest-override + PUBLIC -Wreorder PUBLIC -fno-sized-deallocation PUBLIC $<$:-g> # PUBLIC $<$:-O0> diff --git a/src/DebugServer/Gdb/Connection.hpp b/src/DebugServer/Gdb/Connection.hpp index 3ff006b3..9c642932 100644 --- a/src/DebugServer/Gdb/Connection.hpp +++ b/src/DebugServer/Gdb/Connection.hpp @@ -43,8 +43,8 @@ namespace DebugServer::Gdb Connection& operator = (Connection&&) = delete; Connection(Connection&& other) noexcept - : interruptEventNotifier(other.interruptEventNotifier) - , socketFileDescriptor(other.socketFileDescriptor) + : socketFileDescriptor(other.socketFileDescriptor) + , interruptEventNotifier(other.interruptEventNotifier) , epollInstance(std::move(other.epollInstance)) , readInterruptEnabled(other.readInterruptEnabled) { diff --git a/src/DebugServer/Gdb/TargetDescriptor.cpp b/src/DebugServer/Gdb/TargetDescriptor.cpp index b4c3ea46..38b73af4 100644 --- a/src/DebugServer/Gdb/TargetDescriptor.cpp +++ b/src/DebugServer/Gdb/TargetDescriptor.cpp @@ -10,9 +10,9 @@ namespace DebugServer::Gdb std::map targetRegisterDescriptorIdsByGdbRegisterId ) : targetDescriptor(targetDescriptor) + , gdbRegisterDescriptorsById(gdbRegisterDescriptorsById) , memoryOffsetsByType(memoryOffsetsByType) , memoryOffsets(memoryOffsetsByType.getValues()) - , gdbRegisterDescriptorsById(gdbRegisterDescriptorsById) , gdbRegisterIdsByTargetRegisterDescriptorId(gdbRegisterIdsByTargetRegisterDescriptorId) , targetRegisterDescriptorIdsByGdbRegisterId(targetRegisterDescriptorIdsByGdbRegisterId) {} diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp index 3c42554f..40d35ea4 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -96,9 +96,9 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr : edbgInterface(edbgInterface) , targetConfig(targetConfig) , family(targetFamily) + , configVariant(EdbgAvr8Interface::resolveConfigVariant(targetFamily, targetConfig.physicalInterface)) , targetParameters(targetParameters) , targetRegisterDescriptorsById(targetRegisterDescriptorsById) - , configVariant(EdbgAvr8Interface::resolveConfigVariant(targetFamily, targetConfig.physicalInterface)) {} void EdbgAvr8Interface::init() { diff --git a/src/DebugToolDrivers/USB/HID/HidInterface.cpp b/src/DebugToolDrivers/USB/HID/HidInterface.cpp index a2613ffd..db9f3a88 100644 --- a/src/DebugToolDrivers/USB/HID/HidInterface.cpp +++ b/src/DebugToolDrivers/USB/HID/HidInterface.cpp @@ -16,8 +16,8 @@ namespace Usb std::uint16_t productId ) : interfaceNumber(interfaceNumber) - , vendorId(vendorId) , inputReportSize(inputReportSize) + , vendorId(vendorId) , productId(productId) {} diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index 43499f54..8b9ef158 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -150,9 +150,9 @@ Insight::Insight( void Insight::activateMainWindow() { if (this->mainWindow == nullptr) { this->mainWindow = new InsightWindow( - this->environmentConfig, - this->insightConfig, this->insightProjectSettings, + this->insightConfig, + this->environmentConfig, this->targetDescriptor ); diff --git a/src/Insight/Insight.hpp b/src/Insight/Insight.hpp index cd3455bd..70f5646d 100644 --- a/src/Insight/Insight.hpp +++ b/src/Insight/Insight.hpp @@ -67,13 +67,14 @@ public: private: static constexpr std::uint8_t INSIGHT_WORKER_COUNT = 3; + EventListener& eventListener; + ProjectConfig projectConfig; EnvironmentConfig environmentConfig; InsightConfig insightConfig; InsightProjectSettings& insightProjectSettings; - EventListener& eventListener; Services::TargetControllerService targetControllerService = Services::TargetControllerService(); Targets::TargetDescriptor targetDescriptor = this->targetControllerService.getTargetDescriptor(); diff --git a/src/Insight/InsightWorker/Tasks/ConstructHexViewerTopLevelGroupItem.hpp b/src/Insight/InsightWorker/Tasks/ConstructHexViewerTopLevelGroupItem.hpp index 58dc559c..576b9c28 100644 --- a/src/Insight/InsightWorker/Tasks/ConstructHexViewerTopLevelGroupItem.hpp +++ b/src/Insight/InsightWorker/Tasks/ConstructHexViewerTopLevelGroupItem.hpp @@ -34,7 +34,7 @@ protected: void run(Services::TargetControllerService&) override; private: - const Widgets::HexViewerSharedState& hexViewerState; const std::vector& focusedMemoryRegions; const std::vector& excludedMemoryRegions; + const Widgets::HexViewerSharedState& hexViewerState; }; diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp index b10d05a1..4a9ff757 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp @@ -30,16 +30,16 @@ using Targets::TargetPinDescriptor; using Targets::TargetMemoryType; InsightWindow::InsightWindow( - const EnvironmentConfig& environmentConfig, - const InsightConfig& insightConfig, InsightProjectSettings& insightProjectSettings, + const InsightConfig& insightConfig, + const EnvironmentConfig& environmentConfig, const Targets::TargetDescriptor& targetDescriptor ) : QMainWindow(nullptr) + , insightProjectSettings(insightProjectSettings) + , insightConfig(insightConfig) , environmentConfig(environmentConfig) , targetConfig(environmentConfig.targetConfig) - , insightConfig(insightConfig) - , insightProjectSettings(insightProjectSettings) , targetDescriptor(targetDescriptor) { this->setObjectName("main-window"); diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.hpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.hpp index c8b2fea7..168ffb43 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.hpp @@ -31,9 +31,9 @@ class InsightWindow: public QMainWindow public: InsightWindow( - const EnvironmentConfig& environmentConfig, - const InsightConfig& insightConfig, InsightProjectSettings& insightProjectSettings, + const InsightConfig& insightConfig, + const EnvironmentConfig& environmentConfig, const Targets::TargetDescriptor& targetDescriptor ); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/LabeledSeparator.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/LabeledSeparator.cpp index ae071a97..8a73fbe7 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/LabeledSeparator.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/LabeledSeparator.cpp @@ -2,7 +2,10 @@ namespace Widgets { - LabeledSeparator::LabeledSeparator(QString title, QWidget* parent): title(std::move(title)), QWidget(parent) { + LabeledSeparator::LabeledSeparator(QString title, QWidget* parent) + : QWidget(parent) + , title(std::move(title)) + { this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); this->setFixedHeight(LabeledSeparator::DEFAULT_HEIGHT); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListScene.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListScene.cpp index 2867777e..77dd81c3 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListScene.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListScene.cpp @@ -12,8 +12,8 @@ namespace Widgets ListScene::ListItemSetType&& items, QGraphicsView* parent ) - : parent(parent) - , QGraphicsScene(parent) + : QGraphicsScene(parent) + , parent(parent) { this->setItemIndexMethod(QGraphicsScene::NoIndex); this->setItems(std::move(items)); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp index ed71cc04..5a90324c 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp @@ -3,9 +3,9 @@ namespace Widgets { PaneWidget::PaneWidget(PaneState& state, PanelWidget* parent) - : state(state) + : QWidget(parent) + , state(state) , parentPanel(parent) - , QWidget(parent) { this->setMouseTracking(false); this->setAttribute(Qt::WA_Hover, true); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp index 1eff1adf..bc457f63 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp @@ -8,9 +8,9 @@ namespace Widgets { PanelWidget::PanelWidget(PanelWidgetType type, PanelState& state, QWidget* parent) - : panelType(type) + : QFrame(parent) , state(state) - , QFrame(parent) + , panelType(type) { this->setMouseTracking(false); this->setAttribute(Qt::WA_Hover, true); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressItem.cpp index 9a2df5f8..47249baf 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteAddressItem.cpp @@ -3,8 +3,8 @@ namespace Widgets { ByteAddressItem::ByteAddressItem(const HexViewerSharedState& hexViewerState, QGraphicsItem* parent) - : hexViewerState(hexViewerState) - , QGraphicsItem(parent) + : QGraphicsItem(parent) + , hexViewerState(hexViewerState) {} void ByteAddressItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ContextMenuAction.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ContextMenuAction.cpp index b943dea2..353836be 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ContextMenuAction.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ContextMenuAction.cpp @@ -7,7 +7,7 @@ namespace Widgets std::optional isEnabledCallback, QWidget* parent ) - : isEnabledCallback(isEnabledCallback) - , QAction(text, parent) + : QAction(text, parent) + , isEnabledCallback(isEnabledCallback) {} } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerItem.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerItem.hpp index cb3907da..b98b57e6 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerItem.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerItem.hpp @@ -18,10 +18,10 @@ namespace Widgets static constexpr int RIGHT_MARGIN = 5; static constexpr int BOTTOM_MARGIN = 5; - HexViewerItem* parent = nullptr; - const Targets::TargetMemoryAddress startAddress = 0; + HexViewerItem* parent = nullptr; + QPoint relativePosition = {}; HexViewerItem(Targets::TargetMemoryAddress startAddress, HexViewerItem* parent = nullptr); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp index 580358c4..5306b669 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp @@ -51,11 +51,11 @@ namespace Widgets const Targets::TargetMemoryDescriptor& targetMemoryDescriptor; const std::optional& data; + HexViewerWidgetSettings& settings; + const std::vector& focusedMemoryRegions; const std::vector& excludedMemoryRegions; - HexViewerWidgetSettings& settings; - QWidget* container = nullptr; QWidget* toolBar = nullptr; QWidget* bottomBar = nullptr; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ItemGraphicsScene.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ItemGraphicsScene.cpp index bda747c4..97442079 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ItemGraphicsScene.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ItemGraphicsScene.cpp @@ -25,7 +25,8 @@ namespace Widgets HexViewerWidgetSettings& settings, QGraphicsView* parent ) - : state( + : QGraphicsScene(parent) + , state( HexViewerSharedState( targetMemoryDescriptor, data, @@ -35,7 +36,6 @@ namespace Widgets , focusedMemoryRegions(focusedMemoryRegions) , excludedMemoryRegions(excludedMemoryRegions) , parent(parent) - , QGraphicsScene(parent) { this->setObjectName("byte-widget-container"); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp index 700b5060..8a1e6f34 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/ExcludedRegionItem.cpp @@ -13,7 +13,8 @@ namespace Widgets const Targets::TargetMemoryDescriptor& memoryDescriptor, QWidget* parent ) - : memoryRegion(region), RegionItem(region, memoryDescriptor, parent) + : RegionItem(region, memoryDescriptor, parent) + , memoryRegion(region) { auto formUiFile = QFile( QString::fromStdString(Services::PathService::compiledResourcesPath() diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp index fb7235e1..1c8cf8ce 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/FocusedRegionItem.cpp @@ -15,7 +15,8 @@ namespace Widgets const Targets::TargetMemoryDescriptor& memoryDescriptor, QWidget* parent ) - : memoryRegion(region), RegionItem(region, memoryDescriptor, parent) + : RegionItem(region, memoryDescriptor, parent) + , memoryRegion(region) { auto formUiFile = QFile( QString::fromStdString(Services::PathService::compiledResourcesPath() diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.cpp index ed6f7b5f..76bb5bf2 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemoryRegionManager/RegionItem.cpp @@ -12,8 +12,8 @@ namespace Widgets const Targets::TargetMemoryDescriptor& memoryDescriptor, QWidget* parent ) - : memoryDescriptor(memoryDescriptor) - , ClickableWidget(parent) + : ClickableWidget(parent) + , memoryDescriptor(memoryDescriptor) { this->setObjectName("region-item"); this->setFixedHeight(50); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp index d47689db..cb4c3195 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp @@ -35,8 +35,6 @@ namespace Widgets Q_OBJECT public: - TargetMemoryInspectionPaneSettings& settings; - TargetMemoryInspectionPane( const Targets::TargetMemoryDescriptor& targetMemoryDescriptor, TargetMemoryInspectionPaneSettings& settings, @@ -58,6 +56,8 @@ namespace Widgets private: const Targets::TargetMemoryDescriptor& targetMemoryDescriptor; + TargetMemoryInspectionPaneSettings& settings; + std::optional data; std::optional stackPointer; std::optional> activeRefreshTask; diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index c0962819..a956773f 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -21,8 +21,8 @@ namespace Targets::Microchip::Avr::Avr8Bit Avr8::Avr8(const TargetConfig& targetConfig) : targetConfig(Avr8TargetConfig(targetConfig)) , targetDescriptionFile(TargetDescription::TargetDescriptionFile(this->targetConfig.name)) - , name(this->targetDescriptionFile.getTargetName()) , signature(this->targetDescriptionFile.getTargetSignature()) + , name(this->targetDescriptionFile.getTargetName()) , family(this->targetDescriptionFile.getFamily()) , targetParameters(this->targetDescriptionFile.getTargetParameters()) , supportedPhysicalInterfaces(this->targetDescriptionFile.getSupportedPhysicalInterfaces()) diff --git a/src/Targets/TargetRegister.hpp b/src/Targets/TargetRegister.hpp index 40167040..f7f4be3b 100644 --- a/src/Targets/TargetRegister.hpp +++ b/src/Targets/TargetRegister.hpp @@ -44,9 +44,9 @@ namespace Targets { public: TargetRegisterDescriptorId id; + TargetRegisterType type; std::optional startAddress; TargetMemorySize size; - TargetRegisterType type; TargetMemoryType memoryType; std::optional name; @@ -106,8 +106,8 @@ namespace Targets TargetMemoryBuffer value; TargetRegister(TargetRegisterDescriptorId descriptorId, std::vector value) - : value(std::move(value)) - , descriptorId(descriptorId) + : descriptorId(descriptorId) + , value(std::move(value)) {}; [[nodiscard]] std::size_t size() const {