Refactored GDB server base class, making it a template class, allowing for much more flexibility for derived target-specific implementations

This commit is contained in:
Nav
2024-10-25 22:22:25 +01:00
parent 72d0c28d08
commit 8be311cbc0
40 changed files with 675 additions and 780 deletions

View File

@@ -15,15 +15,13 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
using namespace Exceptions;
FlashDone::FlashDone(const RawPacket& rawPacket, const TargetDescriptor& targetDescriptor)
FlashDone::FlashDone(const RawPacket& rawPacket)
: CommandPacket(rawPacket)
, programMemoryAddressSpaceDescriptor(targetDescriptor.programAddressSpaceDescriptor)
, programMemorySegmentDescriptor(targetDescriptor.programMemorySegmentDescriptor)
{}
void FlashDone::handle(
Gdb::DebugSession& debugSession,
const Gdb::TargetDescriptor& gdbTargetDescriptor,
DebugSession& debugSession,
const AvrGdbTargetDescriptor& gdbTargetDescriptor,
const Targets::TargetDescriptor& targetDescriptor,
TargetControllerService& targetControllerService
) {
@@ -42,8 +40,8 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
targetControllerService.enableProgrammingMode();
targetControllerService.writeMemory(
this->programMemoryAddressSpaceDescriptor,
this->programMemorySegmentDescriptor,
gdbTargetDescriptor.programAddressSpaceDescriptor,
gdbTargetDescriptor.programMemorySegmentDescriptor,
debugSession.programmingSession->startAddress,
std::move(debugSession.programmingSession->buffer)
);