From d353b55f9b9610e259efaaee4cfff95058de0cae Mon Sep 17 00:00:00 2001 From: Nav Date: Mon, 26 Dec 2022 21:27:19 +0000 Subject: [PATCH] Renamed TargetControllerConsole to TargetControllerService --- src/CMakeLists.txt | 3 + src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/FlashDone.cpp | 14 +- .../Gdb/AvrGdb/CommandPackets/FlashDone.hpp | 2 +- .../Gdb/AvrGdb/CommandPackets/FlashErase.cpp | 10 +- .../Gdb/AvrGdb/CommandPackets/FlashErase.hpp | 2 +- .../Gdb/AvrGdb/CommandPackets/FlashWrite.cpp | 6 +- .../Gdb/AvrGdb/CommandPackets/FlashWrite.hpp | 2 +- .../Gdb/AvrGdb/CommandPackets/ReadMemory.cpp | 6 +- .../Gdb/AvrGdb/CommandPackets/ReadMemory.hpp | 2 +- .../AvrGdb/CommandPackets/ReadMemoryMap.cpp | 4 +- .../AvrGdb/CommandPackets/ReadMemoryMap.hpp | 2 +- .../Gdb/AvrGdb/CommandPackets/WriteMemory.cpp | 6 +- .../Gdb/AvrGdb/CommandPackets/WriteMemory.hpp | 2 +- .../Gdb/CommandPackets/BloomVersion.cpp | 4 +- .../Gdb/CommandPackets/BloomVersion.hpp | 2 +- .../CommandPackets/BloomVersionMachine.cpp | 4 +- .../CommandPackets/BloomVersionMachine.hpp | 2 +- .../Gdb/CommandPackets/CommandPacket.cpp | 4 +- .../Gdb/CommandPackets/CommandPacket.hpp | 6 +- .../Gdb/CommandPackets/ContinueExecution.cpp | 6 +- .../Gdb/CommandPackets/ContinueExecution.hpp | 2 +- src/DebugServer/Gdb/CommandPackets/Detach.cpp | 6 +- src/DebugServer/Gdb/CommandPackets/Detach.hpp | 2 +- .../Gdb/CommandPackets/EepromFill.cpp | 6 +- .../Gdb/CommandPackets/EepromFill.hpp | 2 +- .../Gdb/CommandPackets/GenerateSvd.cpp | 4 +- .../Gdb/CommandPackets/GenerateSvd.hpp | 2 +- .../Gdb/CommandPackets/HelpMonitorInfo.cpp | 4 +- .../Gdb/CommandPackets/HelpMonitorInfo.hpp | 2 +- .../Gdb/CommandPackets/InterruptExecution.cpp | 6 +- .../Gdb/CommandPackets/InterruptExecution.hpp | 2 +- .../Gdb/CommandPackets/Monitor.cpp | 4 +- .../Gdb/CommandPackets/Monitor.hpp | 2 +- .../Gdb/CommandPackets/ReadRegisters.cpp | 6 +- .../Gdb/CommandPackets/ReadRegisters.hpp | 2 +- .../Gdb/CommandPackets/RemoveBreakpoint.cpp | 6 +- .../Gdb/CommandPackets/RemoveBreakpoint.hpp | 2 +- .../Gdb/CommandPackets/ResetTarget.cpp | 6 +- .../Gdb/CommandPackets/ResetTarget.hpp | 2 +- .../Gdb/CommandPackets/SetBreakpoint.cpp | 6 +- .../Gdb/CommandPackets/SetBreakpoint.hpp | 2 +- .../Gdb/CommandPackets/StepExecution.cpp | 6 +- .../Gdb/CommandPackets/StepExecution.hpp | 2 +- .../CommandPackets/SupportedFeaturesQuery.cpp | 4 +- .../CommandPackets/SupportedFeaturesQuery.hpp | 2 +- .../Gdb/CommandPackets/WriteRegister.cpp | 6 +- .../Gdb/CommandPackets/WriteRegister.hpp | 2 +- src/DebugServer/Gdb/GdbRspDebugServer.cpp | 12 +- src/DebugServer/Gdb/GdbRspDebugServer.hpp | 4 +- src/DebugServer/Gdb/README.md | 10 +- src/Insight/Insight.cpp | 4 +- src/Insight/Insight.hpp | 4 +- src/Insight/InsightWorker/InsightWorker.cpp | 2 +- src/Insight/InsightWorker/InsightWorker.hpp | 4 +- .../Tasks/CaptureMemorySnapshot.cpp | 10 +- .../Tasks/CaptureMemorySnapshot.hpp | 2 +- .../Tasks/ConstructHexViewerByteItems.cpp | 2 +- .../Tasks/ConstructHexViewerByteItems.hpp | 2 +- .../Tasks/GetTargetDescriptor.cpp | 6 +- .../Tasks/GetTargetDescriptor.hpp | 2 +- .../InsightWorker/Tasks/GetTargetState.cpp | 6 +- .../InsightWorker/Tasks/GetTargetState.hpp | 2 +- .../InsightWorker/Tasks/InsightWorkerTask.cpp | 6 +- .../InsightWorker/Tasks/InsightWorkerTask.hpp | 6 +- .../Tasks/ReadProgramCounter.cpp | 6 +- .../Tasks/ReadProgramCounter.hpp | 2 +- .../InsightWorker/Tasks/ReadStackPointer.cpp | 6 +- .../InsightWorker/Tasks/ReadStackPointer.hpp | 2 +- .../InsightWorker/Tasks/ReadTargetMemory.cpp | 8 +- .../InsightWorker/Tasks/ReadTargetMemory.hpp | 2 +- .../Tasks/ReadTargetRegisters.cpp | 6 +- .../Tasks/ReadTargetRegisters.hpp | 2 +- .../Tasks/RefreshTargetPinStates.cpp | 6 +- .../Tasks/RefreshTargetPinStates.hpp | 2 +- .../Tasks/RetrieveMemorySnapshots.cpp | 4 +- .../Tasks/RetrieveMemorySnapshots.hpp | 2 +- .../InsightWorker/Tasks/SetTargetPinState.cpp | 6 +- .../InsightWorker/Tasks/SetTargetPinState.hpp | 2 +- .../Tasks/WriteTargetRegister.cpp | 6 +- .../Tasks/WriteTargetRegister.hpp | 2 +- .../TargetControllerService.cpp} | 146 +++++++++--------- .../TargetControllerService.hpp} | 16 +- src/TargetController/CMakeLists.txt | 1 - src/TargetController/README.md | 18 +-- 85 files changed, 261 insertions(+), 257 deletions(-) rename src/{TargetController/TargetControllerConsole.cpp => Services/TargetControllerService.cpp} (57%) rename src/{TargetController/TargetControllerConsole.hpp => Services/TargetControllerService.hpp} (93%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f4532f7e..16849611 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,6 +4,9 @@ target_sources( ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Application.cpp + # Services + ${CMAKE_CURRENT_SOURCE_DIR}/Services/TargetControllerService.cpp + # Helpers & other ${CMAKE_CURRENT_SOURCE_DIR}/Logger/Logger.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/Paths.cpp diff --git a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp index a663424d..096a43ad 100644 --- a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp +++ b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp @@ -27,7 +27,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb DebugServer::Gdb::GdbRspDebugServer::init(); this->gdbTargetDescriptor = TargetDescriptor( - this->targetControllerConsole.getTargetDescriptor() + this->targetControllerService.getTargetDescriptor() ); } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp index ccf58e88..85b5985b 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp @@ -8,7 +8,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using ResponsePackets::OkResponsePacket; @@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets : CommandPacket(rawPacket) {} - void FlashDone::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void FlashDone::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling FlashDone packet"); try { @@ -29,9 +29,9 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets "Flushing " + std::to_string(programmingSession.buffer.size()) + " bytes to target's program memory" ); - targetControllerConsole.enableProgrammingMode(); + targetControllerService.enableProgrammingMode(); - targetControllerConsole.writeMemory( + targetControllerService.writeMemory( Targets::TargetMemoryType::FLASH, programmingSession.startAddress, std::move(programmingSession.buffer) @@ -41,10 +41,10 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets } Logger::warning("Program memory updated"); - targetControllerConsole.disableProgrammingMode(); + targetControllerService.disableProgrammingMode(); Logger::warning("Resetting target"); - targetControllerConsole.resetTarget(); + targetControllerService.resetTarget(); Logger::info("Target reset complete"); debugSession.connection.writePacket(OkResponsePacket()); @@ -54,7 +54,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets debugSession.programmingSession.reset(); try { - targetControllerConsole.disableProgrammingMode(); + targetControllerService.disableProgrammingMode(); } catch (const Exception& exception) { Logger::error("Failed to disable programming mode - " + exception.getMessage()); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.hpp index aee736c9..6d8de761 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.hpp @@ -20,7 +20,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.cpp index 0d9bfab4..881f6e42 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.cpp @@ -8,7 +8,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using ResponsePackets::OkResponsePacket; @@ -48,16 +48,16 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets } } - void FlashErase::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void FlashErase::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling FlashErase packet"); try { - targetControllerConsole.enableProgrammingMode(); + targetControllerService.enableProgrammingMode(); Logger::warning("Erasing entire chip, in preparation for programming"); // We don't erase a specific address range - we just erase the entire program memory. - targetControllerConsole.eraseMemory(Targets::TargetMemoryType::FLASH); + targetControllerService.eraseMemory(Targets::TargetMemoryType::FLASH); debugSession.connection.writePacket(OkResponsePacket()); @@ -66,7 +66,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets debugSession.programmingSession.reset(); try { - targetControllerConsole.disableProgrammingMode(); + targetControllerService.disableProgrammingMode(); } catch (const Exception& exception) { Logger::error("Failed to disable programming mode - " + exception.getMessage()); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.hpp index d45141f0..dfaaa647 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.hpp @@ -24,7 +24,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.cpp index b3a730e7..063fdeea 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.cpp @@ -10,7 +10,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using ResponsePackets::OkResponsePacket; @@ -48,7 +48,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets this->buffer = Targets::TargetMemoryBuffer(colonIt + 1, this->data.end()); } - void FlashWrite::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void FlashWrite::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling FlashWrite packet"); try { @@ -91,7 +91,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets debugSession.programmingSession.reset(); try { - targetControllerConsole.disableProgrammingMode(); + targetControllerService.disableProgrammingMode(); } catch (const Exception& exception) { Logger::error("Failed to disable programming mode - " + exception.getMessage()); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.hpp index 9cef10bc..d671c620 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.hpp @@ -24,7 +24,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp index 7e69ca1c..0b1e1bcd 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp @@ -10,7 +10,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using ResponsePackets::ResponsePacket; @@ -62,7 +62,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets } } - void ReadMemory::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void ReadMemory::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling ReadMemory packet"); try { @@ -136,7 +136,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets auto memoryBuffer = Targets::TargetMemoryBuffer(); if (bytesToRead > 0) { - memoryBuffer = targetControllerConsole.readMemory( + memoryBuffer = targetControllerService.readMemory( this->memoryType, this->startAddress, bytesToRead diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp index 92a9c536..f2980a00 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp @@ -36,7 +36,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp index fa282b03..0fb8f0e0 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp @@ -6,7 +6,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ResponsePacket; @@ -50,7 +50,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets } } - void ReadMemoryMap::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void ReadMemoryMap::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling ReadMemoryMap packet"); using Targets::TargetMemoryType; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp index 6aa40a2c..e7a9eea1 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp @@ -27,7 +27,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp index e473692a..2a85098d 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp @@ -8,7 +8,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using ResponsePackets::OkResponsePacket; @@ -68,7 +68,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets } } - void WriteMemory::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void WriteMemory::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling WriteMemory packet"); try { @@ -123,7 +123,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets ); } - targetControllerConsole.writeMemory( + targetControllerService.writeMemory( this->memoryType, this->startAddress, this->buffer diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp index ab89a79e..1bc1661b 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp @@ -36,7 +36,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/BloomVersion.cpp b/src/DebugServer/Gdb/CommandPackets/BloomVersion.cpp index 9a2fd7a7..b7463538 100644 --- a/src/DebugServer/Gdb/CommandPackets/BloomVersion.cpp +++ b/src/DebugServer/Gdb/CommandPackets/BloomVersion.cpp @@ -15,7 +15,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using ResponsePackets::ResponsePacket; @@ -26,7 +26,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets : Monitor(std::move(monitorPacket)) {} - void BloomVersion::handle(DebugSession& debugSession, TargetControllerConsole&) { + void BloomVersion::handle(DebugSession& debugSession, TargetControllerService&) { Logger::debug("Handling BloomVersion packet"); debugSession.connection.writePacket(ResponsePacket(String::toHex( diff --git a/src/DebugServer/Gdb/CommandPackets/BloomVersion.hpp b/src/DebugServer/Gdb/CommandPackets/BloomVersion.hpp index 45462c5e..ac66fa20 100644 --- a/src/DebugServer/Gdb/CommandPackets/BloomVersion.hpp +++ b/src/DebugServer/Gdb/CommandPackets/BloomVersion.hpp @@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.cpp b/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.cpp index 8d9c35f4..b3655b29 100644 --- a/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.cpp +++ b/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.cpp @@ -15,7 +15,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ResponsePacket; @@ -25,7 +25,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets : Monitor(std::move(monitorPacket)) {} - void BloomVersionMachine::handle(DebugSession& debugSession, TargetControllerConsole&) { + void BloomVersionMachine::handle(DebugSession& debugSession, TargetControllerService&) { Logger::debug("Handling BloomVersionMachine packet"); debugSession.connection.writePacket(ResponsePacket(String::toHex( diff --git a/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.hpp b/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.hpp index 17d5619f..82fd949e 100644 --- a/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.hpp +++ b/src/DebugServer/Gdb/CommandPackets/BloomVersionMachine.hpp @@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/CommandPacket.cpp b/src/DebugServer/Gdb/CommandPackets/CommandPacket.cpp index fe2047c2..6f5320e2 100644 --- a/src/DebugServer/Gdb/CommandPackets/CommandPacket.cpp +++ b/src/DebugServer/Gdb/CommandPackets/CommandPacket.cpp @@ -13,7 +13,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ResponsePacket; using ResponsePackets::OkResponsePacket; @@ -23,7 +23,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets using Exceptions::Exception; - void CommandPacket::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void CommandPacket::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { const auto packetString = std::string(this->data.begin(), this->data.end()); if (packetString.empty()) { diff --git a/src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp b/src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp index b8e22840..3dee46c3 100644 --- a/src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp +++ b/src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp @@ -6,7 +6,7 @@ #include "src/DebugServer/Gdb/Packet.hpp" #include "src/DebugServer/Gdb/DebugSession.hpp" -#include "src/TargetController/TargetControllerConsole.hpp" +#include "src/Services/TargetControllerService.hpp" namespace Bloom::DebugServer::Gdb::CommandPackets { @@ -44,11 +44,11 @@ namespace Bloom::DebugServer::Gdb::CommandPackets * @param debugSession * The current active debug session. * - * @param targetControllerConsole + * @param TargetControllerService */ virtual void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ); }; } diff --git a/src/DebugServer/Gdb/CommandPackets/ContinueExecution.cpp b/src/DebugServer/Gdb/CommandPackets/ContinueExecution.cpp index 24a47250..d1e9021e 100644 --- a/src/DebugServer/Gdb/CommandPackets/ContinueExecution.cpp +++ b/src/DebugServer/Gdb/CommandPackets/ContinueExecution.cpp @@ -7,7 +7,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using Exceptions::Exception; @@ -22,11 +22,11 @@ namespace Bloom::DebugServer::Gdb::CommandPackets } } - void ContinueExecution::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void ContinueExecution::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling ContinueExecution packet"); try { - targetControllerConsole.continueTargetExecution(this->fromProgramCounter); + targetControllerService.continueTargetExecution(this->fromProgramCounter); debugSession.waitingForBreak = true; } catch (const Exception& exception) { diff --git a/src/DebugServer/Gdb/CommandPackets/ContinueExecution.hpp b/src/DebugServer/Gdb/CommandPackets/ContinueExecution.hpp index 2fa0c074..aec146c7 100644 --- a/src/DebugServer/Gdb/CommandPackets/ContinueExecution.hpp +++ b/src/DebugServer/Gdb/CommandPackets/ContinueExecution.hpp @@ -30,7 +30,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/Detach.cpp b/src/DebugServer/Gdb/CommandPackets/Detach.cpp index b8aaa0f8..41d112d5 100644 --- a/src/DebugServer/Gdb/CommandPackets/Detach.cpp +++ b/src/DebugServer/Gdb/CommandPackets/Detach.cpp @@ -9,7 +9,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::OkResponsePacket; using ResponsePackets::ErrorResponsePacket; @@ -20,12 +20,12 @@ namespace Bloom::DebugServer::Gdb::CommandPackets : CommandPacket(rawPacket) {} - void Detach::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void Detach::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling Detach packet"); try { if (Process::isManagedByClion()) { - targetControllerConsole.suspendTargetController(); + targetControllerService.suspendTargetController(); } debugSession.connection.writePacket(OkResponsePacket()); diff --git a/src/DebugServer/Gdb/CommandPackets/Detach.hpp b/src/DebugServer/Gdb/CommandPackets/Detach.hpp index a002ab86..8289e159 100644 --- a/src/DebugServer/Gdb/CommandPackets/Detach.hpp +++ b/src/DebugServer/Gdb/CommandPackets/Detach.hpp @@ -11,7 +11,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/EepromFill.cpp b/src/DebugServer/Gdb/CommandPackets/EepromFill.cpp index 4a677b74..c2a6f909 100644 --- a/src/DebugServer/Gdb/CommandPackets/EepromFill.cpp +++ b/src/DebugServer/Gdb/CommandPackets/EepromFill.cpp @@ -14,7 +14,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ResponsePacket; using ResponsePackets::ErrorResponsePacket; @@ -34,7 +34,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets this->fillValue = Targets::TargetMemoryBuffer(fillValueByteArray.begin(), fillValueByteArray.end()); } - void EepromFill::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void EepromFill::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling EepromFill packet"); try { @@ -90,7 +90,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets const auto hexValues = String::toHex(data); Logger::debug("Filling EEPROM with values: " + hexValues); - targetControllerConsole.writeMemory( + targetControllerService.writeMemory( Targets::TargetMemoryType::EEPROM, eepromDescriptor.addressRange.startAddress, std::move(data) diff --git a/src/DebugServer/Gdb/CommandPackets/EepromFill.hpp b/src/DebugServer/Gdb/CommandPackets/EepromFill.hpp index 534f847c..320537cc 100644 --- a/src/DebugServer/Gdb/CommandPackets/EepromFill.hpp +++ b/src/DebugServer/Gdb/CommandPackets/EepromFill.hpp @@ -20,7 +20,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; private: diff --git a/src/DebugServer/Gdb/CommandPackets/GenerateSvd.cpp b/src/DebugServer/Gdb/CommandPackets/GenerateSvd.cpp index fb061dc2..d2ec5fc9 100644 --- a/src/DebugServer/Gdb/CommandPackets/GenerateSvd.cpp +++ b/src/DebugServer/Gdb/CommandPackets/GenerateSvd.cpp @@ -17,7 +17,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ResponsePacket; using ResponsePackets::ErrorResponsePacket; @@ -28,7 +28,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets , sendOutput(this->commandOptions.contains("out")) {} - void GenerateSvd::handle(DebugSession& debugSession, TargetControllerConsole&) { + void GenerateSvd::handle(DebugSession& debugSession, TargetControllerService&) { Logger::debug("Handling GenerateSvd packet"); try { diff --git a/src/DebugServer/Gdb/CommandPackets/GenerateSvd.hpp b/src/DebugServer/Gdb/CommandPackets/GenerateSvd.hpp index 6bbd26c9..f01a9c7f 100644 --- a/src/DebugServer/Gdb/CommandPackets/GenerateSvd.hpp +++ b/src/DebugServer/Gdb/CommandPackets/GenerateSvd.hpp @@ -21,7 +21,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; private: diff --git a/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.cpp b/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.cpp index ade98dde..fd16c901 100644 --- a/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.cpp +++ b/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.cpp @@ -14,7 +14,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using ResponsePackets::ResponsePacket; @@ -25,7 +25,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets : Monitor(std::move(monitorPacket)) {} - void HelpMonitorInfo::handle(DebugSession& debugSession, TargetControllerConsole&) { + void HelpMonitorInfo::handle(DebugSession& debugSession, TargetControllerService&) { Logger::debug("Handling HelpMonitorInfo packet"); try { diff --git a/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.hpp b/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.hpp index 4cf8ecd9..bfd04e68 100644 --- a/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.hpp +++ b/src/DebugServer/Gdb/CommandPackets/HelpMonitorInfo.hpp @@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/InterruptExecution.cpp b/src/DebugServer/Gdb/CommandPackets/InterruptExecution.cpp index bbb2f1e4..ea15a6a4 100644 --- a/src/DebugServer/Gdb/CommandPackets/InterruptExecution.cpp +++ b/src/DebugServer/Gdb/CommandPackets/InterruptExecution.cpp @@ -9,17 +9,17 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::TargetStopped; using ResponsePackets::ErrorResponsePacket; using Exceptions::Exception; - void InterruptExecution::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void InterruptExecution::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling InterruptExecution packet"); try { - targetControllerConsole.stopTargetExecution(); + targetControllerService.stopTargetExecution(); debugSession.connection.writePacket(TargetStopped(Signal::INTERRUPTED)); } catch (const Exception& exception) { diff --git a/src/DebugServer/Gdb/CommandPackets/InterruptExecution.hpp b/src/DebugServer/Gdb/CommandPackets/InterruptExecution.hpp index fa9cf3b2..e4613b3b 100644 --- a/src/DebugServer/Gdb/CommandPackets/InterruptExecution.hpp +++ b/src/DebugServer/Gdb/CommandPackets/InterruptExecution.hpp @@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/Monitor.cpp b/src/DebugServer/Gdb/CommandPackets/Monitor.cpp index 676e7a47..f07d21cb 100644 --- a/src/DebugServer/Gdb/CommandPackets/Monitor.cpp +++ b/src/DebugServer/Gdb/CommandPackets/Monitor.cpp @@ -6,7 +6,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::EmptyResponsePacket; @@ -27,7 +27,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets this->commandOptions = this->extractCommandOptions(this->command); } - void Monitor::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void Monitor::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::error("Unknown custom GDB command (\"" + this->command + "\") received."); debugSession.connection.writePacket(EmptyResponsePacket()); } diff --git a/src/DebugServer/Gdb/CommandPackets/Monitor.hpp b/src/DebugServer/Gdb/CommandPackets/Monitor.hpp index 0de0811f..b564c64c 100644 --- a/src/DebugServer/Gdb/CommandPackets/Monitor.hpp +++ b/src/DebugServer/Gdb/CommandPackets/Monitor.hpp @@ -33,7 +33,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; private: diff --git a/src/DebugServer/Gdb/CommandPackets/ReadRegisters.cpp b/src/DebugServer/Gdb/CommandPackets/ReadRegisters.cpp index 196f7059..6e8213e0 100644 --- a/src/DebugServer/Gdb/CommandPackets/ReadRegisters.cpp +++ b/src/DebugServer/Gdb/CommandPackets/ReadRegisters.cpp @@ -11,7 +11,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using Targets::TargetRegister; using Targets::TargetRegisterDescriptors; @@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets } } - void ReadRegisters::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void ReadRegisters::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling ReadRegisters packet"); try { @@ -52,7 +52,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets } } - auto registerSet = targetControllerConsole.readRegisters(descriptors); + auto registerSet = targetControllerService.readRegisters(descriptors); /* * Sort each register by their respective GDB register number - this will leave us with a collection of diff --git a/src/DebugServer/Gdb/CommandPackets/ReadRegisters.hpp b/src/DebugServer/Gdb/CommandPackets/ReadRegisters.hpp index 5b88911c..7b032058 100644 --- a/src/DebugServer/Gdb/CommandPackets/ReadRegisters.hpp +++ b/src/DebugServer/Gdb/CommandPackets/ReadRegisters.hpp @@ -29,7 +29,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/RemoveBreakpoint.cpp b/src/DebugServer/Gdb/CommandPackets/RemoveBreakpoint.cpp index 1e99d6a6..efc0c50d 100644 --- a/src/DebugServer/Gdb/CommandPackets/RemoveBreakpoint.cpp +++ b/src/DebugServer/Gdb/CommandPackets/RemoveBreakpoint.cpp @@ -12,7 +12,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using Targets::TargetBreakpoint; @@ -50,11 +50,11 @@ namespace Bloom::DebugServer::Gdb::CommandPackets } } - void RemoveBreakpoint::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void RemoveBreakpoint::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Removing breakpoint at address " + std::to_string(this->address)); try { - targetControllerConsole.removeBreakpoint(TargetBreakpoint(this->address)); + targetControllerService.removeBreakpoint(TargetBreakpoint(this->address)); debugSession.connection.writePacket(OkResponsePacket()); } catch (const Exception& exception) { diff --git a/src/DebugServer/Gdb/CommandPackets/RemoveBreakpoint.hpp b/src/DebugServer/Gdb/CommandPackets/RemoveBreakpoint.hpp index 09403587..712e6025 100644 --- a/src/DebugServer/Gdb/CommandPackets/RemoveBreakpoint.hpp +++ b/src/DebugServer/Gdb/CommandPackets/RemoveBreakpoint.hpp @@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/ResetTarget.cpp b/src/DebugServer/Gdb/CommandPackets/ResetTarget.cpp index 86715e35..ef45ed3a 100644 --- a/src/DebugServer/Gdb/CommandPackets/ResetTarget.cpp +++ b/src/DebugServer/Gdb/CommandPackets/ResetTarget.cpp @@ -10,7 +10,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; using ResponsePackets::ResponsePacket; @@ -21,12 +21,12 @@ namespace Bloom::DebugServer::Gdb::CommandPackets : Monitor(std::move(monitorPacket)) {} - void ResetTarget::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void ResetTarget::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling ResetTarget packet"); try { Logger::warning("Resetting target"); - targetControllerConsole.resetTarget(); + targetControllerService.resetTarget(); Logger::info("Target reset complete"); debugSession.connection.writePacket(ResponsePacket(String::toHex( diff --git a/src/DebugServer/Gdb/CommandPackets/ResetTarget.hpp b/src/DebugServer/Gdb/CommandPackets/ResetTarget.hpp index dc895eef..c9a3a13c 100644 --- a/src/DebugServer/Gdb/CommandPackets/ResetTarget.hpp +++ b/src/DebugServer/Gdb/CommandPackets/ResetTarget.hpp @@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/SetBreakpoint.cpp b/src/DebugServer/Gdb/CommandPackets/SetBreakpoint.cpp index 9739a838..59366563 100644 --- a/src/DebugServer/Gdb/CommandPackets/SetBreakpoint.cpp +++ b/src/DebugServer/Gdb/CommandPackets/SetBreakpoint.cpp @@ -12,7 +12,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using Targets::TargetBreakpoint; @@ -50,11 +50,11 @@ namespace Bloom::DebugServer::Gdb::CommandPackets } } - void SetBreakpoint::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void SetBreakpoint::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling SetBreakpoint packet"); try { - targetControllerConsole.setBreakpoint(TargetBreakpoint(this->address)); + targetControllerService.setBreakpoint(TargetBreakpoint(this->address)); debugSession.connection.writePacket(OkResponsePacket()); } catch (const Exception& exception) { diff --git a/src/DebugServer/Gdb/CommandPackets/SetBreakpoint.hpp b/src/DebugServer/Gdb/CommandPackets/SetBreakpoint.hpp index e8fd6f5f..e837bed3 100644 --- a/src/DebugServer/Gdb/CommandPackets/SetBreakpoint.hpp +++ b/src/DebugServer/Gdb/CommandPackets/SetBreakpoint.hpp @@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/StepExecution.cpp b/src/DebugServer/Gdb/CommandPackets/StepExecution.cpp index b26795a2..72722ba0 100644 --- a/src/DebugServer/Gdb/CommandPackets/StepExecution.cpp +++ b/src/DebugServer/Gdb/CommandPackets/StepExecution.cpp @@ -7,7 +7,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::ErrorResponsePacket; @@ -23,11 +23,11 @@ namespace Bloom::DebugServer::Gdb::CommandPackets } } - void StepExecution::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void StepExecution::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling StepExecution packet"); try { - targetControllerConsole.stepTargetExecution(this->fromProgramCounter); + targetControllerService.stepTargetExecution(this->fromProgramCounter); debugSession.waitingForBreak = true; } catch (const Exception& exception) { diff --git a/src/DebugServer/Gdb/CommandPackets/StepExecution.hpp b/src/DebugServer/Gdb/CommandPackets/StepExecution.hpp index dae751f1..b4e883d3 100644 --- a/src/DebugServer/Gdb/CommandPackets/StepExecution.hpp +++ b/src/DebugServer/Gdb/CommandPackets/StepExecution.hpp @@ -25,7 +25,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/CommandPackets/SupportedFeaturesQuery.cpp b/src/DebugServer/Gdb/CommandPackets/SupportedFeaturesQuery.cpp index a4de96ac..d4b92839 100644 --- a/src/DebugServer/Gdb/CommandPackets/SupportedFeaturesQuery.cpp +++ b/src/DebugServer/Gdb/CommandPackets/SupportedFeaturesQuery.cpp @@ -13,7 +13,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using ResponsePackets::SupportedFeaturesResponse; using ResponsePackets::ErrorResponsePacket; @@ -53,7 +53,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets } } - void SupportedFeaturesQuery::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void SupportedFeaturesQuery::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling QuerySupport packet"); if (!this->isFeatureSupported(Feature::HARDWARE_BREAKPOINTS) diff --git a/src/DebugServer/Gdb/CommandPackets/SupportedFeaturesQuery.hpp b/src/DebugServer/Gdb/CommandPackets/SupportedFeaturesQuery.hpp index cd6f5d7f..b8eeba08 100644 --- a/src/DebugServer/Gdb/CommandPackets/SupportedFeaturesQuery.hpp +++ b/src/DebugServer/Gdb/CommandPackets/SupportedFeaturesQuery.hpp @@ -34,7 +34,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; private: diff --git a/src/DebugServer/Gdb/CommandPackets/WriteRegister.cpp b/src/DebugServer/Gdb/CommandPackets/WriteRegister.cpp index 49af7436..1d497bad 100644 --- a/src/DebugServer/Gdb/CommandPackets/WriteRegister.cpp +++ b/src/DebugServer/Gdb/CommandPackets/WriteRegister.cpp @@ -11,7 +11,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; using Targets::TargetRegister; using Targets::TargetRegisterDescriptors; @@ -42,7 +42,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets std::reverse(this->registerValue.begin(), this->registerValue.end()); } - void WriteRegister::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { + void WriteRegister::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { Logger::debug("Handling WriteRegister packet"); try { @@ -72,7 +72,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets } } - targetControllerConsole.writeRegisters({ + targetControllerService.writeRegisters({ TargetRegister(targetRegisterDescriptor, this->registerValue) }); diff --git a/src/DebugServer/Gdb/CommandPackets/WriteRegister.hpp b/src/DebugServer/Gdb/CommandPackets/WriteRegister.hpp index 1c2a03c4..47dcccc9 100644 --- a/src/DebugServer/Gdb/CommandPackets/WriteRegister.hpp +++ b/src/DebugServer/Gdb/CommandPackets/WriteRegister.hpp @@ -21,7 +21,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets void handle( DebugSession& debugSession, - TargetController::TargetControllerConsole& targetControllerConsole + Services::TargetControllerService& targetControllerService ) override; }; } diff --git a/src/DebugServer/Gdb/GdbRspDebugServer.cpp b/src/DebugServer/Gdb/GdbRspDebugServer.cpp index 3fc5d910..d4d2e294 100644 --- a/src/DebugServer/Gdb/GdbRspDebugServer.cpp +++ b/src/DebugServer/Gdb/GdbRspDebugServer.cpp @@ -160,29 +160,29 @@ namespace Bloom::DebugServer::Gdb * Before proceeding with a new debug session, we must ensure that the TargetController is able to * service it. */ - if (!this->targetControllerConsole.isTargetControllerInService()) { + if (!this->targetControllerService.isTargetControllerInService()) { // The TargetController is suspended - attempt to wake it up try { - this->targetControllerConsole.resumeTargetController(); + this->targetControllerService.resumeTargetController(); } catch (Bloom::Exceptions::Exception& exception) { Logger::error("Failed to wake up TargetController - " + exception.getMessage()); } - if (!this->targetControllerConsole.isTargetControllerInService()) { + if (!this->targetControllerService.isTargetControllerInService()) { this->activeDebugSession.reset(); throw DebugSessionInitialisationFailure("TargetController not in service"); } } - this->targetControllerConsole.stopTargetExecution(); - this->targetControllerConsole.resetTarget(); + this->targetControllerService.stopTargetExecution(); + this->targetControllerService.resetTarget(); } const auto commandPacket = this->waitForCommandPacket(); if (commandPacket) { - commandPacket->handle(this->activeDebugSession.value(), this->targetControllerConsole); + commandPacket->handle(this->activeDebugSession.value(), this->targetControllerService); } } catch (const ClientDisconnected&) { diff --git a/src/DebugServer/Gdb/GdbRspDebugServer.hpp b/src/DebugServer/Gdb/GdbRspDebugServer.hpp index 79444a1c..983ad0b4 100644 --- a/src/DebugServer/Gdb/GdbRspDebugServer.hpp +++ b/src/DebugServer/Gdb/GdbRspDebugServer.hpp @@ -13,7 +13,7 @@ #include "src/EventManager/EventListener.hpp" #include "src/Helpers/EpollInstance.hpp" #include "src/Helpers/EventFdNotifier.hpp" -#include "src/TargetController/TargetControllerConsole.hpp" +#include "src/Services/TargetControllerService.hpp" #include "Connection.hpp" #include "TargetDescriptor.hpp" @@ -114,7 +114,7 @@ namespace Bloom::DebugServer::Gdb * * See documentation in src/DebugServer/Gdb/README.md for more on how GDB commands are processed. */ - TargetController::TargetControllerConsole targetControllerConsole = TargetController::TargetControllerConsole(); + Services::TargetControllerService targetControllerService = Services::TargetControllerService(); /** * Listening socket address diff --git a/src/DebugServer/Gdb/README.md b/src/DebugServer/Gdb/README.md index f662cec7..60a6bb23 100644 --- a/src/DebugServer/Gdb/README.md +++ b/src/DebugServer/Gdb/README.md @@ -53,7 +53,7 @@ public: explicit SetBreakpoint(const RawPacket& rawPacket); - void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) override; + void handle(DebugSession& debugSession, TargetControllerService& targetControllerService) override; }; ``` @@ -67,15 +67,15 @@ Upon receiving a command packet from the GDB client, the command must be handled Each command packet class implements a `handle()` member function. This function is called upon receipt of the command and is expected to handle the command and deliver any necessary response to the client. Two parameters are passed to the `handle()` member function - a reference to the active `DebugSession` object, and a reference to a -`TargetControllerConsole` object. The `DebugSession` object provides access to the current connection with the GDB -client, as well as other debug session specific information. The `TargetControllerConsole` object provides an interface +`TargetControllerService` object. The `DebugSession` object provides access to the current connection with the GDB +client, as well as other debug session specific information. The `TargetControllerService` object provides an interface to the `TargetController`, for any GDB commands that need to interface with the connected target (see the [TargetController documentation](../../TargetController/README.md) for more on this). Handling the `SetBreakpoint` command packet: ```c++ -void SetBreakpoint::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) { +void SetBreakpoint::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) { /* * I know the breakpoint type (this->type) isn't used in here - this is because the current implementation only * supports software breakpoints, so we don't do anything with this->type, for now. @@ -84,7 +84,7 @@ void SetBreakpoint::handle(DebugSession& debugSession, TargetControllerConsole& Logger::debug("Handling SetBreakpoint packet"); try { - targetControllerConsole.setBreakpoint(TargetBreakpoint(this->address)); + targetControllerServicesetBreakpoint(TargetBreakpoint(this->address)); debugSession.connection.writePacket(OkResponsePacket()); } catch (const Exception& exception) { diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index 066b032b..0e737a73 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -206,7 +206,7 @@ namespace Bloom this->checkBloomVersion(); - this->mainWindow->init(this->targetControllerConsole.getTargetDescriptor()); + this->mainWindow->init(this->targetControllerService.getTargetDescriptor()); this->mainWindow->show(); } @@ -322,7 +322,7 @@ namespace Bloom void Insight::onTargetResetEvent(const Events::TargetReset& event) { try { - if (this->targetControllerConsole.getTargetState() != TargetState::STOPPED) { + if (this->targetControllerService.getTargetState() != TargetState::STOPPED) { return; } diff --git a/src/Insight/Insight.hpp b/src/Insight/Insight.hpp index 7957dbf9..f1ab531e 100644 --- a/src/Insight/Insight.hpp +++ b/src/Insight/Insight.hpp @@ -17,7 +17,7 @@ #include "src/EventManager/EventListener.hpp" #include "src/EventManager/Events/Events.hpp" -#include "src/TargetController/TargetControllerConsole.hpp" +#include "src/Services/TargetControllerService.hpp" #include "src/Targets/TargetState.hpp" #include "InsightSignals.hpp" @@ -90,7 +90,7 @@ namespace Bloom this->insightProjectSettings ); - TargetController::TargetControllerConsole targetControllerConsole = TargetController::TargetControllerConsole(); + Services::TargetControllerService targetControllerService = Services::TargetControllerService(); Targets::TargetState lastTargetState = Targets::TargetState::UNKNOWN; bool targetStepping = false; diff --git a/src/Insight/InsightWorker/InsightWorker.cpp b/src/Insight/InsightWorker/InsightWorker.cpp index 7da4ec04..47c38f61 100644 --- a/src/Insight/InsightWorker/InsightWorker.cpp +++ b/src/Insight/InsightWorker/InsightWorker.cpp @@ -83,7 +83,7 @@ namespace Bloom auto* task = queuedTask.value(); task->moveToThread(this->thread()); task->setParent(this); - task->execute(this->targetControllerConsole); + task->execute(this->targetControllerService); { const auto taskGroupsLock = InsightWorker::taskGroupsInExecution.acquireLock(); diff --git a/src/Insight/InsightWorker/InsightWorker.hpp b/src/Insight/InsightWorker/InsightWorker.hpp index eed7cd2d..124d9af8 100644 --- a/src/Insight/InsightWorker/InsightWorker.hpp +++ b/src/Insight/InsightWorker/InsightWorker.hpp @@ -9,7 +9,7 @@ #include "Tasks/InsightWorkerTask.hpp" #include "src/Helpers/SyncSafe.hpp" -#include "src/TargetController/TargetControllerConsole.hpp" +#include "src/Services/TargetControllerService.hpp" namespace Bloom { @@ -41,7 +41,7 @@ namespace Bloom static inline SyncSafe> queuedTasksById = {}; static inline SyncSafe taskGroupsInExecution = {}; - TargetController::TargetControllerConsole targetControllerConsole = TargetController::TargetControllerConsole(); + Services::TargetControllerService targetControllerService = Services::TargetControllerService(); void executeTasks(); }; diff --git a/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.cpp b/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.cpp index 8c3e2bf5..ad6b4a03 100644 --- a/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.cpp +++ b/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.cpp @@ -10,7 +10,7 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; CaptureMemorySnapshot::CaptureMemorySnapshot( const QString& name, @@ -28,12 +28,12 @@ namespace Bloom , data(data) {} - void CaptureMemorySnapshot::run(TargetControllerConsole& targetControllerConsole) { + void CaptureMemorySnapshot::run(TargetControllerService& targetControllerService) { using Targets::TargetMemorySize; Logger::info("Capturing snapshot"); - const auto& targetDescriptor = targetControllerConsole.getTargetDescriptor(); + const auto& targetDescriptor = targetControllerService.getTargetDescriptor(); const auto memoryDescriptorIt = targetDescriptor.memoryDescriptorsByType.find(this->memoryType); if (memoryDescriptorIt == targetDescriptor.memoryDescriptorsByType.end()) { @@ -58,7 +58,7 @@ namespace Bloom ); for (std::uint32_t i = 0; i < readsRequired; i++) { - auto dataSegment = targetControllerConsole.readMemory( + auto dataSegment = targetControllerService.readMemory( this->memoryType, memoryDescriptor.addressRange.startAddress + static_cast(readSize * i), (memorySize - this->data->size()) >= readSize @@ -78,7 +78,7 @@ namespace Bloom std::move(this->description), this->memoryType, std::move(*this->data), - targetControllerConsole.getProgramCounter(), + targetControllerService.getProgramCounter(), std::move(this->focusedRegions), std::move(this->excludedRegions) ); diff --git a/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.hpp b/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.hpp index 66c25869..43af500b 100644 --- a/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.hpp +++ b/src/Insight/InsightWorker/Tasks/CaptureMemorySnapshot.hpp @@ -28,7 +28,7 @@ namespace Bloom void memorySnapshotCaptured(MemorySnapshot snapshot); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; private: QString name; diff --git a/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItems.cpp b/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItems.cpp index 54ae33f7..3515d99e 100644 --- a/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItems.cpp +++ b/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItems.cpp @@ -20,7 +20,7 @@ namespace Bloom qRegisterMetaType>(); } - void ConstructHexViewerByteItems::run(TargetController::TargetControllerConsole&) { + void ConstructHexViewerByteItems::run(Services::TargetControllerService&) { const auto memorySize = this->memoryDescriptor.size(); const auto startAddress = this->memoryDescriptor.addressRange.startAddress; diff --git a/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItems.hpp b/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItems.hpp index b75202f3..79455e19 100644 --- a/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItems.hpp +++ b/src/Insight/InsightWorker/Tasks/ConstructHexViewerByteItems.hpp @@ -37,7 +37,7 @@ namespace Bloom void byteItems(std::map byteItemsByAddress); protected: - void run(TargetController::TargetControllerConsole&) override; + void run(Services::TargetControllerService&) override; private: std::map byteItemsByAddress; diff --git a/src/Insight/InsightWorker/Tasks/GetTargetDescriptor.cpp b/src/Insight/InsightWorker/Tasks/GetTargetDescriptor.cpp index 0729f7eb..30224dfc 100644 --- a/src/Insight/InsightWorker/Tasks/GetTargetDescriptor.cpp +++ b/src/Insight/InsightWorker/Tasks/GetTargetDescriptor.cpp @@ -2,9 +2,9 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void GetTargetDescriptor::run(TargetControllerConsole& targetControllerConsole) { - emit this->targetDescriptor(targetControllerConsole.getTargetDescriptor()); + void GetTargetDescriptor::run(TargetControllerService& targetControllerService) { + emit this->targetDescriptor(targetControllerService.getTargetDescriptor()); } } diff --git a/src/Insight/InsightWorker/Tasks/GetTargetDescriptor.hpp b/src/Insight/InsightWorker/Tasks/GetTargetDescriptor.hpp index 851394af..ee420ff9 100644 --- a/src/Insight/InsightWorker/Tasks/GetTargetDescriptor.hpp +++ b/src/Insight/InsightWorker/Tasks/GetTargetDescriptor.hpp @@ -23,6 +23,6 @@ namespace Bloom void targetDescriptor(Targets::TargetDescriptor targetDescriptor); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; }; } diff --git a/src/Insight/InsightWorker/Tasks/GetTargetState.cpp b/src/Insight/InsightWorker/Tasks/GetTargetState.cpp index 67e05cd3..cd874967 100644 --- a/src/Insight/InsightWorker/Tasks/GetTargetState.cpp +++ b/src/Insight/InsightWorker/Tasks/GetTargetState.cpp @@ -2,9 +2,9 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void GetTargetState::run(TargetControllerConsole& targetControllerConsole) { - emit this->targetState(targetControllerConsole.getTargetState()); + void GetTargetState::run(TargetControllerService& targetControllerService) { + emit this->targetState(targetControllerService.getTargetState()); } } diff --git a/src/Insight/InsightWorker/Tasks/GetTargetState.hpp b/src/Insight/InsightWorker/Tasks/GetTargetState.hpp index fdc68dfa..814bd4b6 100644 --- a/src/Insight/InsightWorker/Tasks/GetTargetState.hpp +++ b/src/Insight/InsightWorker/Tasks/GetTargetState.hpp @@ -23,6 +23,6 @@ namespace Bloom void targetState(Targets::TargetState state); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; }; } diff --git a/src/Insight/InsightWorker/Tasks/InsightWorkerTask.cpp b/src/Insight/InsightWorker/Tasks/InsightWorkerTask.cpp index 721cba89..36ae306e 100644 --- a/src/Insight/InsightWorker/Tasks/InsightWorkerTask.cpp +++ b/src/Insight/InsightWorker/Tasks/InsightWorkerTask.cpp @@ -4,13 +4,13 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void InsightWorkerTask::execute(TargetControllerConsole& targetControllerConsole) { + void InsightWorkerTask::execute(TargetControllerService& targetControllerService) { try { this->state = InsightWorkerTaskState::STARTED; emit this->started(); - this->run(targetControllerConsole); + this->run(targetControllerService); this->state = InsightWorkerTaskState::COMPLETED; emit this->completed(); diff --git a/src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp b/src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp index 3a8eee23..dba8c6c7 100644 --- a/src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp +++ b/src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp @@ -4,7 +4,7 @@ #include #include "TaskGroup.hpp" -#include "src/TargetController/TargetControllerConsole.hpp" +#include "src/Services/TargetControllerService.hpp" namespace Bloom { @@ -29,7 +29,7 @@ namespace Bloom return TaskGroups(); }; - void execute(TargetController::TargetControllerConsole& targetControllerConsole); + void execute(Services::TargetControllerService& targetControllerService); signals: /** @@ -56,6 +56,6 @@ namespace Bloom void finished(); protected: - virtual void run(TargetController::TargetControllerConsole& targetControllerConsole) = 0; + virtual void run(Services::TargetControllerService& targetControllerService) = 0; }; } diff --git a/src/Insight/InsightWorker/Tasks/ReadProgramCounter.cpp b/src/Insight/InsightWorker/Tasks/ReadProgramCounter.cpp index f476d4c6..83a9db5c 100644 --- a/src/Insight/InsightWorker/Tasks/ReadProgramCounter.cpp +++ b/src/Insight/InsightWorker/Tasks/ReadProgramCounter.cpp @@ -2,9 +2,9 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void ReadProgramCounter::run(TargetControllerConsole& targetControllerConsole) { - emit this->programCounterRead(targetControllerConsole.getProgramCounter()); + void ReadProgramCounter::run(TargetControllerService& targetControllerService) { + emit this->programCounterRead(targetControllerService.getProgramCounter()); } } diff --git a/src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp b/src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp index 0cbb95f0..4e9e60fe 100644 --- a/src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp +++ b/src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp @@ -23,6 +23,6 @@ namespace Bloom void programCounterRead(Targets::TargetProgramCounter programCounter); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; }; } diff --git a/src/Insight/InsightWorker/Tasks/ReadStackPointer.cpp b/src/Insight/InsightWorker/Tasks/ReadStackPointer.cpp index 16073781..d8aeed04 100644 --- a/src/Insight/InsightWorker/Tasks/ReadStackPointer.cpp +++ b/src/Insight/InsightWorker/Tasks/ReadStackPointer.cpp @@ -2,9 +2,9 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void ReadStackPointer::run(TargetControllerConsole& targetControllerConsole) { - emit this->stackPointerRead(targetControllerConsole.getStackPointer()); + void ReadStackPointer::run(TargetControllerService& targetControllerService) { + emit this->stackPointerRead(targetControllerService.getStackPointer()); } } diff --git a/src/Insight/InsightWorker/Tasks/ReadStackPointer.hpp b/src/Insight/InsightWorker/Tasks/ReadStackPointer.hpp index 6600820f..c1d3f5a9 100644 --- a/src/Insight/InsightWorker/Tasks/ReadStackPointer.hpp +++ b/src/Insight/InsightWorker/Tasks/ReadStackPointer.hpp @@ -23,6 +23,6 @@ namespace Bloom void stackPointerRead(Targets::TargetStackPointer stackPointer); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; }; } diff --git a/src/Insight/InsightWorker/Tasks/ReadTargetMemory.cpp b/src/Insight/InsightWorker/Tasks/ReadTargetMemory.cpp index 4a4a04d7..cd631cc2 100644 --- a/src/Insight/InsightWorker/Tasks/ReadTargetMemory.cpp +++ b/src/Insight/InsightWorker/Tasks/ReadTargetMemory.cpp @@ -8,12 +8,12 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void ReadTargetMemory::run(TargetControllerConsole& targetControllerConsole) { + void ReadTargetMemory::run(TargetControllerService& targetControllerService) { using Targets::TargetMemorySize; - const auto& targetDescriptor = targetControllerConsole.getTargetDescriptor(); + const auto& targetDescriptor = targetControllerService.getTargetDescriptor(); const auto memoryDescriptorIt = targetDescriptor.memoryDescriptorsByType.find(this->memoryType); if (memoryDescriptorIt == targetDescriptor.memoryDescriptorsByType.end()) { @@ -39,7 +39,7 @@ namespace Bloom Targets::TargetMemoryBuffer data; for (std::uint32_t i = 0; i < readsRequired; i++) { - auto dataSegment = targetControllerConsole.readMemory( + auto dataSegment = targetControllerService.readMemory( this->memoryType, this->startAddress + static_cast(readSize * i), (this->size - data.size()) >= readSize diff --git a/src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp b/src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp index 9084d778..fce32881 100644 --- a/src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp +++ b/src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp @@ -35,7 +35,7 @@ namespace Bloom void targetMemoryRead(Targets::TargetMemoryBuffer buffer); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; private: Targets::TargetMemoryType memoryType; diff --git a/src/Insight/InsightWorker/Tasks/ReadTargetRegisters.cpp b/src/Insight/InsightWorker/Tasks/ReadTargetRegisters.cpp index 2415a4ae..16a2a750 100644 --- a/src/Insight/InsightWorker/Tasks/ReadTargetRegisters.cpp +++ b/src/Insight/InsightWorker/Tasks/ReadTargetRegisters.cpp @@ -2,9 +2,9 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void ReadTargetRegisters::run(TargetControllerConsole& targetControllerConsole) { - emit this->targetRegistersRead(targetControllerConsole.readRegisters(this->descriptors)); + void ReadTargetRegisters::run(TargetControllerService& targetControllerService) { + emit this->targetRegistersRead(targetControllerService.readRegisters(this->descriptors)); } } diff --git a/src/Insight/InsightWorker/Tasks/ReadTargetRegisters.hpp b/src/Insight/InsightWorker/Tasks/ReadTargetRegisters.hpp index 5d5a8283..93c27d7b 100644 --- a/src/Insight/InsightWorker/Tasks/ReadTargetRegisters.hpp +++ b/src/Insight/InsightWorker/Tasks/ReadTargetRegisters.hpp @@ -24,7 +24,7 @@ namespace Bloom void targetRegistersRead(Targets::TargetRegisters registers); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; private: Targets::TargetRegisterDescriptors descriptors; diff --git a/src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.cpp b/src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.cpp index b92543c6..f3d00e7f 100644 --- a/src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.cpp +++ b/src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.cpp @@ -2,9 +2,9 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void RefreshTargetPinStates::run(TargetControllerConsole& targetControllerConsole) { - emit this->targetPinStatesRetrieved(targetControllerConsole.getPinStates(this->variantId)); + void RefreshTargetPinStates::run(TargetControllerService& targetControllerService) { + emit this->targetPinStatesRetrieved(targetControllerService.getPinStates(this->variantId)); } } diff --git a/src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.hpp b/src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.hpp index 742bf602..2f899e86 100644 --- a/src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.hpp +++ b/src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.hpp @@ -25,7 +25,7 @@ namespace Bloom void targetPinStatesRetrieved(Bloom::Targets::TargetPinStateMapping pinStatesByNumber); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; private: int variantId; diff --git a/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.cpp b/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.cpp index afceb98e..8399f680 100644 --- a/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.cpp +++ b/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.cpp @@ -12,13 +12,13 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; RetrieveMemorySnapshots::RetrieveMemorySnapshots(Targets::TargetMemoryType memoryType) : memoryType(memoryType) {} - void RetrieveMemorySnapshots::run(TargetControllerConsole& targetControllerConsole) { + void RetrieveMemorySnapshots::run(TargetControllerService& targetControllerService) { emit this->memorySnapshotsRetrieved(this->getSnapshots(this->memoryType)); } diff --git a/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.hpp b/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.hpp index 73deccd6..731c4b79 100644 --- a/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.hpp +++ b/src/Insight/InsightWorker/Tasks/RetrieveMemorySnapshots.hpp @@ -20,7 +20,7 @@ namespace Bloom void memorySnapshotsRetrieved(std::vector snapshots); protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; private: Targets::TargetMemoryType memoryType; diff --git a/src/Insight/InsightWorker/Tasks/SetTargetPinState.cpp b/src/Insight/InsightWorker/Tasks/SetTargetPinState.cpp index c63be906..083e9899 100644 --- a/src/Insight/InsightWorker/Tasks/SetTargetPinState.cpp +++ b/src/Insight/InsightWorker/Tasks/SetTargetPinState.cpp @@ -2,9 +2,9 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void SetTargetPinState::run(TargetControllerConsole& targetControllerConsole) { - targetControllerConsole.setPinState(this->pinDescriptor, this->pinState); + void SetTargetPinState::run(TargetControllerService& targetControllerService) { + targetControllerService.setPinState(this->pinDescriptor, this->pinState); } } diff --git a/src/Insight/InsightWorker/Tasks/SetTargetPinState.hpp b/src/Insight/InsightWorker/Tasks/SetTargetPinState.hpp index 312bbbaa..dbf44e13 100644 --- a/src/Insight/InsightWorker/Tasks/SetTargetPinState.hpp +++ b/src/Insight/InsightWorker/Tasks/SetTargetPinState.hpp @@ -22,7 +22,7 @@ namespace Bloom }; protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; private: Targets::TargetPinDescriptor pinDescriptor; diff --git a/src/Insight/InsightWorker/Tasks/WriteTargetRegister.cpp b/src/Insight/InsightWorker/Tasks/WriteTargetRegister.cpp index fb8dbf83..5e9ba9bb 100644 --- a/src/Insight/InsightWorker/Tasks/WriteTargetRegister.cpp +++ b/src/Insight/InsightWorker/Tasks/WriteTargetRegister.cpp @@ -2,9 +2,9 @@ namespace Bloom { - using TargetController::TargetControllerConsole; + using Services::TargetControllerService; - void WriteTargetRegister::run(TargetControllerConsole& targetControllerConsole) { - targetControllerConsole.writeRegisters({this->targetRegister}); + void WriteTargetRegister::run(TargetControllerService& targetControllerService) { + targetControllerService.writeRegisters({this->targetRegister}); } } diff --git a/src/Insight/InsightWorker/Tasks/WriteTargetRegister.hpp b/src/Insight/InsightWorker/Tasks/WriteTargetRegister.hpp index 21b61127..082c3927 100644 --- a/src/Insight/InsightWorker/Tasks/WriteTargetRegister.hpp +++ b/src/Insight/InsightWorker/Tasks/WriteTargetRegister.hpp @@ -21,7 +21,7 @@ namespace Bloom }; protected: - void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + void run(Services::TargetControllerService& targetControllerService) override; private: Targets::TargetRegister targetRegister; diff --git a/src/TargetController/TargetControllerConsole.cpp b/src/Services/TargetControllerService.cpp similarity index 57% rename from src/TargetController/TargetControllerConsole.cpp rename to src/Services/TargetControllerService.cpp index 9f4c40a4..a40a244d 100644 --- a/src/TargetController/TargetControllerConsole.cpp +++ b/src/Services/TargetControllerService.cpp @@ -1,55 +1,57 @@ -#include "TargetControllerConsole.hpp" +#include "TargetControllerService.hpp" // Commands -#include "Commands/GetState.hpp" -#include "Commands/Suspend.hpp" -#include "Commands/Resume.hpp" -#include "Commands/GetTargetDescriptor.hpp" -#include "Commands/GetTargetState.hpp" -#include "Commands/StopTargetExecution.hpp" -#include "Commands/ResumeTargetExecution.hpp" -#include "Commands/ResetTarget.hpp" -#include "Commands/ReadTargetRegisters.hpp" -#include "Commands/WriteTargetRegisters.hpp" -#include "Commands/ReadTargetMemory.hpp" -#include "Commands/WriteTargetMemory.hpp" -#include "Commands/EraseTargetMemory.hpp" -#include "Commands/StepTargetExecution.hpp" -#include "Commands/SetBreakpoint.hpp" -#include "Commands/RemoveBreakpoint.hpp" -#include "Commands/SetTargetProgramCounter.hpp" -#include "Commands/GetTargetPinStates.hpp" -#include "Commands/SetTargetPinState.hpp" -#include "Commands/GetTargetStackPointer.hpp" -#include "Commands/GetTargetProgramCounter.hpp" -#include "Commands/EnableProgrammingMode.hpp" -#include "Commands/DisableProgrammingMode.hpp" +#include "src/TargetController/Commands/GetState.hpp" +#include "src/TargetController/Commands/Suspend.hpp" +#include "src/TargetController/Commands/Resume.hpp" +#include "src/TargetController/Commands/GetTargetDescriptor.hpp" +#include "src/TargetController/Commands/GetTargetState.hpp" +#include "src/TargetController/Commands/StopTargetExecution.hpp" +#include "src/TargetController/Commands/ResumeTargetExecution.hpp" +#include "src/TargetController/Commands/ResetTarget.hpp" +#include "src/TargetController/Commands/ReadTargetRegisters.hpp" +#include "src/TargetController/Commands/WriteTargetRegisters.hpp" +#include "src/TargetController/Commands/ReadTargetMemory.hpp" +#include "src/TargetController/Commands/WriteTargetMemory.hpp" +#include "src/TargetController/Commands/EraseTargetMemory.hpp" +#include "src/TargetController/Commands/StepTargetExecution.hpp" +#include "src/TargetController/Commands/SetBreakpoint.hpp" +#include "src/TargetController/Commands/RemoveBreakpoint.hpp" +#include "src/TargetController/Commands/SetTargetProgramCounter.hpp" +#include "src/TargetController/Commands/GetTargetPinStates.hpp" +#include "src/TargetController/Commands/SetTargetPinState.hpp" +#include "src/TargetController/Commands/GetTargetStackPointer.hpp" +#include "src/TargetController/Commands/GetTargetProgramCounter.hpp" +#include "src/TargetController/Commands/EnableProgrammingMode.hpp" +#include "src/TargetController/Commands/DisableProgrammingMode.hpp" -namespace Bloom::TargetController +namespace Bloom::Services { - using Commands::GetState; - using Commands::Suspend; - using Commands::Resume; - using Commands::GetTargetDescriptor; - using Commands::GetTargetState; - using Commands::StopTargetExecution; - using Commands::ResumeTargetExecution; - using Commands::ResetTarget; - using Commands::ReadTargetRegisters; - using Commands::WriteTargetRegisters; - using Commands::ReadTargetMemory; - using Commands::WriteTargetMemory; - using Commands::EraseTargetMemory; - using Commands::StepTargetExecution; - using Commands::SetBreakpoint; - using Commands::RemoveBreakpoint; - using Commands::SetTargetProgramCounter; - using Commands::GetTargetPinStates; - using Commands::SetTargetPinState; - using Commands::GetTargetStackPointer; - using Commands::GetTargetProgramCounter; - using Commands::EnableProgrammingMode; - using Commands::DisableProgrammingMode; + using TargetController::Commands::GetState; + using TargetController::Commands::Suspend; + using TargetController::Commands::Resume; + using TargetController::Commands::GetTargetDescriptor; + using TargetController::Commands::GetTargetState; + using TargetController::Commands::StopTargetExecution; + using TargetController::Commands::ResumeTargetExecution; + using TargetController::Commands::ResetTarget; + using TargetController::Commands::ReadTargetRegisters; + using TargetController::Commands::WriteTargetRegisters; + using TargetController::Commands::ReadTargetMemory; + using TargetController::Commands::WriteTargetMemory; + using TargetController::Commands::EraseTargetMemory; + using TargetController::Commands::StepTargetExecution; + using TargetController::Commands::SetBreakpoint; + using TargetController::Commands::RemoveBreakpoint; + using TargetController::Commands::SetTargetProgramCounter; + using TargetController::Commands::GetTargetPinStates; + using TargetController::Commands::SetTargetPinState; + using TargetController::Commands::GetTargetStackPointer; + using TargetController::Commands::GetTargetProgramCounter; + using TargetController::Commands::EnableProgrammingMode; + using TargetController::Commands::DisableProgrammingMode; + + using TargetController::TargetControllerState; using Targets::TargetDescriptor; using Targets::TargetState; @@ -71,14 +73,14 @@ namespace Bloom::TargetController using Targets::TargetPinState; using Targets::TargetPinStateMapping; - TargetControllerState TargetControllerConsole::getTargetControllerState() { + TargetControllerState TargetControllerService::getTargetControllerState() { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout )->state; } - bool TargetControllerConsole::isTargetControllerInService() noexcept { + bool TargetControllerService::isTargetControllerInService() noexcept { try { return this->getTargetControllerState() == TargetControllerState::ACTIVE; @@ -87,7 +89,7 @@ namespace Bloom::TargetController } } - void TargetControllerConsole::resumeTargetController() { + void TargetControllerService::resumeTargetController() { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout @@ -95,7 +97,7 @@ namespace Bloom::TargetController return; } - void TargetControllerConsole::suspendTargetController() { + void TargetControllerService::suspendTargetController() { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout @@ -103,28 +105,28 @@ namespace Bloom::TargetController return; } - const TargetDescriptor& TargetControllerConsole::getTargetDescriptor() { + const TargetDescriptor& TargetControllerService::getTargetDescriptor() { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout )->targetDescriptor; } - TargetState TargetControllerConsole::getTargetState() { + TargetState TargetControllerService::getTargetState() { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout )->targetState; } - void TargetControllerConsole::stopTargetExecution() { + void TargetControllerService::stopTargetExecution() { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout ); } - void TargetControllerConsole::continueTargetExecution(std::optional fromAddress) { + void TargetControllerService::continueTargetExecution(std::optional fromAddress) { auto resumeExecutionCommand = std::make_unique(); if (fromAddress.has_value()) { @@ -137,7 +139,7 @@ namespace Bloom::TargetController ); } - void TargetControllerConsole::stepTargetExecution(std::optional fromAddress) { + void TargetControllerService::stepTargetExecution(std::optional fromAddress) { auto stepExecutionCommand = std::make_unique(); if (fromAddress.has_value()) { @@ -150,21 +152,21 @@ namespace Bloom::TargetController ); } - TargetRegisters TargetControllerConsole::readRegisters(const TargetRegisterDescriptors& descriptors) { + TargetRegisters TargetControllerService::readRegisters(const TargetRegisterDescriptors& descriptors) { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(descriptors), this->defaultTimeout )->registers; } - void TargetControllerConsole::writeRegisters(const TargetRegisters& registers) { + void TargetControllerService::writeRegisters(const TargetRegisters& registers) { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(registers), this->defaultTimeout ); } - TargetMemoryBuffer TargetControllerConsole::readMemory( + TargetMemoryBuffer TargetControllerService::readMemory( TargetMemoryType memoryType, TargetMemoryAddress startAddress, TargetMemorySize bytes, @@ -181,7 +183,7 @@ namespace Bloom::TargetController )->data; } - void TargetControllerConsole::writeMemory( + void TargetControllerService::writeMemory( TargetMemoryType memoryType, TargetMemoryAddress startAddress, const TargetMemoryBuffer& buffer @@ -192,77 +194,77 @@ namespace Bloom::TargetController ); } - void TargetControllerConsole::eraseMemory(Targets::TargetMemoryType memoryType) { + void TargetControllerService::eraseMemory(Targets::TargetMemoryType memoryType) { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(memoryType), this->defaultTimeout ); } - void TargetControllerConsole::setBreakpoint(TargetBreakpoint breakpoint) { + void TargetControllerService::setBreakpoint(TargetBreakpoint breakpoint) { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(breakpoint), this->defaultTimeout ); } - void TargetControllerConsole::removeBreakpoint(TargetBreakpoint breakpoint) { + void TargetControllerService::removeBreakpoint(TargetBreakpoint breakpoint) { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(breakpoint), this->defaultTimeout ); } - TargetProgramCounter TargetControllerConsole::getProgramCounter() { + TargetProgramCounter TargetControllerService::getProgramCounter() { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout )->programCounter; } - void TargetControllerConsole::setProgramCounter(TargetProgramCounter address) { + void TargetControllerService::setProgramCounter(TargetProgramCounter address) { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(address), this->defaultTimeout ); } - TargetPinStateMapping TargetControllerConsole::getPinStates(int variantId) { + TargetPinStateMapping TargetControllerService::getPinStates(int variantId) { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(variantId), this->defaultTimeout )->pinStatesByNumber; } - void TargetControllerConsole::setPinState(TargetPinDescriptor pinDescriptor, TargetPinState pinState) { + void TargetControllerService::setPinState(TargetPinDescriptor pinDescriptor, TargetPinState pinState) { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(pinDescriptor, pinState), this->defaultTimeout ); } - TargetStackPointer TargetControllerConsole::getStackPointer() { + TargetStackPointer TargetControllerService::getStackPointer() { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout )->stackPointer; } - void TargetControllerConsole::resetTarget() { + void TargetControllerService::resetTarget() { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout ); } - void TargetControllerConsole::enableProgrammingMode() { + void TargetControllerService::enableProgrammingMode() { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout ); } - void TargetControllerConsole::disableProgrammingMode() { + void TargetControllerService::disableProgrammingMode() { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout diff --git a/src/TargetController/TargetControllerConsole.hpp b/src/Services/TargetControllerService.hpp similarity index 93% rename from src/TargetController/TargetControllerConsole.hpp rename to src/Services/TargetControllerService.hpp index af83e6e0..dd86a5ad 100644 --- a/src/TargetController/TargetControllerConsole.hpp +++ b/src/Services/TargetControllerService.hpp @@ -4,8 +4,8 @@ #include #include -#include "CommandManager.hpp" -#include "TargetControllerState.hpp" +#include "src/TargetController/CommandManager.hpp" +#include "src/TargetController/TargetControllerState.hpp" #include "src/Targets/TargetState.hpp" #include "src/Targets/TargetRegister.hpp" @@ -16,15 +16,15 @@ #include "src/Exceptions/Exception.hpp" -namespace Bloom::TargetController +namespace Bloom::Services { /** - * The TargetControllerConsole provides an interface to the TargetController. + * The TargetControllerService provides an interface to the TargetController. */ - class TargetControllerConsole + class TargetControllerService { public: - TargetControllerConsole() = default; + TargetControllerService() = default; void setDefaultTimeout(std::chrono::milliseconds timeout) { this->defaultTimeout = timeout; @@ -39,7 +39,7 @@ namespace Bloom::TargetController * * @return */ - TargetControllerState getTargetControllerState(); + TargetController::TargetControllerState getTargetControllerState(); /** * Retrieves the TargetController state and checks if it's currently active. @@ -215,7 +215,7 @@ namespace Bloom::TargetController void disableProgrammingMode(); private: - CommandManager commandManager = CommandManager(); + TargetController::CommandManager commandManager = TargetController::CommandManager(); std::chrono::milliseconds defaultTimeout = std::chrono::milliseconds(60000); }; diff --git a/src/TargetController/CMakeLists.txt b/src/TargetController/CMakeLists.txt index 6575d927..aa5d28d3 100755 --- a/src/TargetController/CMakeLists.txt +++ b/src/TargetController/CMakeLists.txt @@ -2,5 +2,4 @@ target_sources( Bloom PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/TargetControllerComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/TargetControllerConsole.cpp ) diff --git a/src/TargetController/README.md b/src/TargetController/README.md index aa7c1704..db92c1e2 100644 --- a/src/TargetController/README.md +++ b/src/TargetController/README.md @@ -18,9 +18,9 @@ All TargetController commands can be found in [src/TargetController/Commands](./ [`Bloom::TargetController::Responses::Response`](./Responses/Response.hpp) base class. **NOTE:** Components within Bloom do not typically concern themselves with the TargetController command-response -mechanism. Instead, they use the `TargetControllerConsole` class, which encapsulates the command-response mechanism and +mechanism. Instead, they use the `TargetControllerService` class, which encapsulates the command-response mechanism and provides a simplified means for interaction with the connected hardware. For more, see -[The TargetControllerConsole class](#the-targetcontrollerconsole-class) section below. +[The TargetControllerService class](#the-TargetControllerService-class) section below. Commands can be sent to the TargetController via the [`Bloom::TargetController::CommandManager`](./CommandManager.hpp) class. @@ -53,26 +53,26 @@ until a timeout has been reached. Because it is a template function, it is able type at compile-time (see the `SuccessResponseType` alias in some command classes). If the TargetController responds with an error, or the timeout is reached, `CommandManager::sendCommandAndWaitForResponse()` will throw an exception. -#### The TargetControllerConsole class +#### The TargetControllerService class -The `TargetControllerConsole` class encapsulates the TargetController's command-response mechanism and provides a +The `TargetControllerService` class encapsulates the TargetController's command-response mechanism and provides a simplified means for other components to interact with the connected hardware. Iterating on the example above, to read memory from the target: ```c++ -auto tcConsole = TargetController::TargetControllerConsole(); +auto tcService = Services::TargetControllerService(); -const auto data = tcConsole.readMemory( +const auto data = tcService.readMemory( someMemoryType, // Flash, RAM, EEPROM, etc someStartAddress, someNumberOfBytes ); ``` -The `TargetControllerConsole` class does not require any dependencies at construction. It can be constructed in +The `TargetControllerService` class does not require any dependencies at construction. It can be constructed in different threads and used freely to gain access to the connected hardware, from any component within Bloom. -All components within Bloom should use the `TargetControllerConsole` class to interact with the connected hardware. They +All components within Bloom should use the `TargetControllerService` class to interact with the connected hardware. They **should not** directly issue commands via the `Bloom::TargetController::CommandManager`, unless there is a very good reason to do so. @@ -114,7 +114,7 @@ For more on TargetController suspension, see `TargetControllerComponent::suspend When a component needs to write to the target's program memory, it must enable programming mode on the target. This can be done by issuing the `EnableProgrammingMode` command to the TargetController (see -`TargetControllerConsole::enableProgrammingMode()`). Once programming mode has been enabled, the TargetController will +`TargetControllerService::enableProgrammingMode()`). Once programming mode has been enabled, the TargetController will reject any subsequent commands that involve debug operations (such as `ResumeTargetExecution`, `ReadTargetRegisters`, etc), until programming mode has been disabled.