Renamed TargetControllerConsole to TargetControllerService

This commit is contained in:
Nav
2022-12-26 21:27:19 +00:00
parent de97e8d4e0
commit d353b55f9b
85 changed files with 261 additions and 257 deletions

View File

@@ -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(

View File

@@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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(

View File

@@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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()) {

View File

@@ -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
);
};
}

View File

@@ -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) {

View File

@@ -30,7 +30,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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());

View File

@@ -11,7 +11,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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)

View File

@@ -20,7 +20,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
private:

View File

@@ -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 {

View File

@@ -21,7 +21,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
private:

View File

@@ -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 {

View File

@@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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) {

View File

@@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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());
}

View File

@@ -33,7 +33,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
private:

View File

@@ -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

View File

@@ -29,7 +29,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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) {

View File

@@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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(

View File

@@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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) {

View File

@@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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) {

View File

@@ -25,7 +25,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -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)

View File

@@ -34,7 +34,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
private:

View File

@@ -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)
});

View File

@@ -21,7 +21,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}