From 72b3d271a24ef19ff2a35302be3800b3541f11fc Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 14 May 2022 22:43:35 +0100 Subject: [PATCH] Tidying --- CMakeLists.txt | 2 -- src/Application.cpp | 8 ++++---- .../MemoryAccessCommandPacket.hpp | 6 +++--- src/ProjectConfig.hpp | 18 +++++++++--------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdf9aaeb..796d1065 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,6 @@ set(ENABLE_SANITIZERS off) add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) -link_directories(/usr/local/lib) - set(CMAKE_AUTOMOC ON) set(AUTOGEN_BUILD_DIR ../build/) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/bin") diff --git a/src/Application.cpp b/src/Application.cpp index c830fe6b..953aca3c 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -20,7 +20,7 @@ namespace Bloom this->setName("Bloom"); if (!arguments.empty()) { - const auto& firstArg = arguments.front(); + auto& firstArg = arguments.front(); const auto commandsToCallbackMapping = this->getCommandToHandlerMapping(); if (commandsToCallbackMapping.contains(firstArg)) { @@ -32,7 +32,7 @@ namespace Bloom } // If the first argument didn't map to a command, we assume it's an environment name - this->selectedEnvironmentName = firstArg; + this->selectedEnvironmentName = std::move(firstArg); } #ifdef BLOOM_DEBUG_BUILD @@ -153,7 +153,7 @@ namespace Bloom } void Application::shutdown() { - auto appState = Thread::getThreadState(); + const auto appState = Thread::getThreadState(); if (appState == ThreadState::STOPPED || appState == ThreadState::SHUTDOWN_INITIATED) { return; } @@ -244,7 +244,7 @@ namespace Bloom + Paths::projectDirPath()); } - auto jsonObject = QJsonDocument::fromJson(jsonConfigFile.readAll()).object(); + const auto jsonObject = QJsonDocument::fromJson(jsonConfigFile.readAll()).object(); jsonConfigFile.close(); this->projectConfig = ProjectConfig(jsonObject); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/MemoryAccessCommandPacket.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/MemoryAccessCommandPacket.hpp index 984fc0e0..66b6307a 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/MemoryAccessCommandPacket.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/MemoryAccessCommandPacket.hpp @@ -14,8 +14,8 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets * architecture. * * With the GDB implementation for the AVR architecture, read/write memory commands include a special memory - * address. The memory type (FLASH, RAM, EEPROM, etc) is embedded within the 7 most significant bits of the memory - * address. + * address. The memory type (FLASH, RAM, EEPROM, etc) is embedded within the 7 most significant bits of the second + * most significant byte of the memory address. * * This class provides functions to extract and remove the memory type from a given memory address. */ @@ -30,7 +30,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets /** * The mask used by the AVR GDB client to encode the memory type into memory addresses. */ - static constexpr std::uint32_t AVR_GDB_MEMORY_ADDRESS_MASK = 0xFE0000U; + static constexpr std::uint32_t AVR_GDB_MEMORY_ADDRESS_MASK = 0x00FE0000U; /** * avr-gdb uses the most significant 15 bits in memory addresses to indicate the type of memory being diff --git a/src/ProjectConfig.hpp b/src/ProjectConfig.hpp index e30e0de3..1b762408 100644 --- a/src/ProjectConfig.hpp +++ b/src/ProjectConfig.hpp @@ -17,17 +17,17 @@ namespace Bloom * key to allow users to select different debugging environments between debugging sessions. * * On application startup, we extract the config from this JSON file and generate an ProjectConfig object. - * See Application::extractConfig() for more on this. + * See Application::loadProjectConfiguration() for more on this. * * Some config parameters are specific to certain entities within Bloom, but have no significance across the - * rest of the application. For example, AVR8 targets require 'physicalInterface' and 'configVariant' parameters. - * These are used to configure the AVR8 target, but have no significance across the rest of the application. - * This is why some configuration structs (like TargetConfig) include a QJsonObject member, typically named jsonObject. - * When instances of these structs are passed to the appropriate entities, any configuration required by those - * entities is extracted from the jsonObject member. This means we don't have to worry about any entity specific - * config parameters at the application level. We can simply extract what we need at an entity level and the rest - * of the application can remain oblivious. For an example on extracting entity specific config, see - * AVR8::preActivationConfigure(). + * rest of the application. For example, AVR8 targets require the 'physicalInterface' and other AVR8 specific + * parameters. These are used to configure AVR8 targets, but have no significance across the rest of the + * application. This is why some configuration structs (like TargetConfig) include a QJsonObject member, typically + * named jsonObject. When instances of these structs are passed to the appropriate entities, any configuration + * required by those entities is extracted from the jsonObject member. This means we don't have to worry about any + * entity specific config parameters at the application level. We can simply extract what we need at an entity + * level and the rest of the application can remain oblivious. For an example on extracting entity specific + * config, see AVR8::preActivationConfigure(). * * For more on project configuration, see Bloom documentation at https://bloom.oscillate.io/docs/configuration */