diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e1ffd87..d0b41a81 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,7 @@ add_executable(Bloom build/resources/TargetDescriptionFiles/AVR/Mapping.json # Debug servers - src/DebugServers/DebugServer.cpp + src/DebugServers/DebugServerComponent.cpp src/DebugServers/GdbRsp/GdbRspDebugServer.cpp src/DebugServers/GdbRsp/GdbDebugServerConfig.cpp src/DebugServers/GdbRsp/Connection.cpp diff --git a/src/Application.cpp b/src/Application.cpp index 2f99fbbc..114c5524 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -390,12 +390,12 @@ namespace Bloom } void Application::startDebugServer() { - this->debugServer = std::make_unique( + this->debugServer = std::make_unique( this->debugServerConfig.value() ); this->debugServerThread = std::thread( - &DebugServers::DebugServer::run, + &DebugServers::DebugServerComponent::run, this->debugServer.get() ); diff --git a/src/Application.hpp b/src/Application.hpp index ce821336..87755547 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -10,7 +10,7 @@ #include "src/Helpers/Thread.hpp" #include "src/TargetController/TargetController.hpp" -#include "src/DebugServers/DebugServer.hpp" +#include "src/DebugServers/DebugServerComponent.hpp" #include "src/Insight/Insight.hpp" #include "src/SignalHandler/SignalHandler.hpp" @@ -85,7 +85,7 @@ namespace Bloom * * See the DebugServer and GdbRspDebugServer class for more on this. */ - std::unique_ptr debugServer = nullptr; + std::unique_ptr debugServer = nullptr; std::thread debugServerThread; /** diff --git a/src/DebugServers/DebugServer.cpp b/src/DebugServers/DebugServerComponent.cpp similarity index 83% rename from src/DebugServers/DebugServer.cpp rename to src/DebugServers/DebugServerComponent.cpp index 2ea7ff65..096fb89e 100644 --- a/src/DebugServers/DebugServer.cpp +++ b/src/DebugServers/DebugServerComponent.cpp @@ -1,4 +1,4 @@ -#include "DebugServer.hpp" +#include "DebugServerComponent.hpp" #include @@ -12,11 +12,11 @@ namespace Bloom::DebugServers { using namespace Bloom::Events; - DebugServer::DebugServer(const DebugServerConfig& debugServerConfig) + DebugServerComponent::DebugServerComponent(const DebugServerConfig& debugServerConfig) : debugServerConfig(debugServerConfig) {} - void DebugServer::run() { + void DebugServerComponent::run() { try { this->startup(); @@ -33,7 +33,7 @@ namespace Bloom::DebugServers this->shutdown(); } - std::map()>> DebugServer::getAvailableServersByName() { + std::map()>> DebugServerComponent::getAvailableServersByName() { return std::map()>> { { "avr-gdb-rsp", @@ -46,7 +46,7 @@ namespace Bloom::DebugServers }, }; } - void DebugServer::startup() { + void DebugServerComponent::startup() { this->setName("DS"); Logger::info("Starting DebugServer"); @@ -55,7 +55,7 @@ namespace Bloom::DebugServers // Register event handlers this->eventListener->registerCallbackForEventType( - std::bind(&DebugServer::onShutdownDebugServerEvent, this, std::placeholders::_1) + std::bind(&DebugServerComponent::onShutdownDebugServerEvent, this, std::placeholders::_1) ); static const auto availableServersByName = this->getAvailableServersByName(); @@ -72,7 +72,7 @@ namespace Bloom::DebugServers this->setThreadStateAndEmitEvent(ThreadState::READY); } - void DebugServer::shutdown() { + void DebugServerComponent::shutdown() { if (this->getThreadState() == ThreadState::STOPPED || this->getThreadState() == ThreadState::SHUTDOWN_INITIATED ) { @@ -86,7 +86,7 @@ namespace Bloom::DebugServers EventManager::deregisterListener(this->eventListener->getId()); } - void DebugServer::onShutdownDebugServerEvent(const Events::ShutdownDebugServer& event) { + void DebugServerComponent::onShutdownDebugServerEvent(const Events::ShutdownDebugServer& event) { this->shutdown(); } } diff --git a/src/DebugServers/DebugServer.hpp b/src/DebugServers/DebugServerComponent.hpp similarity index 95% rename from src/DebugServers/DebugServer.hpp rename to src/DebugServers/DebugServerComponent.hpp index 8d84df9e..7a894596 100644 --- a/src/DebugServers/DebugServer.hpp +++ b/src/DebugServers/DebugServerComponent.hpp @@ -28,10 +28,10 @@ namespace Bloom::DebugServers * * Bloom currently only supports one DebugServer - the GdbRspDebugServer. */ - class DebugServer: public Thread + class DebugServerComponent: public Thread { public: - explicit DebugServer(const DebugServerConfig& debugServerConfig); + explicit DebugServerComponent(const DebugServerConfig& debugServerConfig); /** * Entry point for the DebugServer. This must called from a dedicated thread.