Renamed TargetControllerConsole to TargetControllerService
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb
|
||||
DebugServer::Gdb::GdbRspDebugServer::init();
|
||||
|
||||
this->gdbTargetDescriptor = TargetDescriptor(
|
||||
this->targetControllerConsole.getTargetDescriptor()
|
||||
this->targetControllerService.getTargetDescriptor()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
|
||||
void handle(
|
||||
DebugSession& debugSession,
|
||||
TargetController::TargetControllerConsole& targetControllerConsole
|
||||
Services::TargetControllerService& targetControllerService
|
||||
) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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&) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user