Included AVR GDB specific implementations of the read and write memory GDB command packets.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
#include "AvrGdbRsp.hpp"
|
#include "AvrGdbRsp.hpp"
|
||||||
|
|
||||||
|
// Command packets
|
||||||
|
#include "CommandPackets/ReadMemory.hpp"
|
||||||
|
#include "CommandPackets/WriteMemory.hpp"
|
||||||
|
|
||||||
namespace Bloom::DebugServers::Gdb::AvrGdb
|
namespace Bloom::DebugServers::Gdb::AvrGdb
|
||||||
{
|
{
|
||||||
using namespace Bloom::Exceptions;
|
using namespace Bloom::Exceptions;
|
||||||
@@ -21,4 +25,23 @@ namespace Bloom::DebugServers::Gdb::AvrGdb
|
|||||||
this->targetControllerConsole.getTargetDescriptor()
|
this->targetControllerConsole.getTargetDescriptor()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Gdb::CommandPackets::CommandPacket> AvrGdbRsp::resolveCommandPacket(
|
||||||
|
const RawPacketType& rawPacket
|
||||||
|
) {
|
||||||
|
using AvrGdb::CommandPackets::ReadMemory;
|
||||||
|
using AvrGdb::CommandPackets::WriteMemory;
|
||||||
|
|
||||||
|
if (rawPacket.size() >= 2) {
|
||||||
|
if (rawPacket[1] == 'm') {
|
||||||
|
return std::make_unique<ReadMemory>(rawPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rawPacket[1] == 'M') {
|
||||||
|
return std::make_unique<WriteMemory>(rawPacket);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return GdbRspDebugServer::resolveCommandPacket(rawPacket);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ namespace Bloom::DebugServers::Gdb::AvrGdb
|
|||||||
return this->gdbTargetDescriptor.value();
|
return this->gdbTargetDescriptor.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Gdb::CommandPackets::CommandPacket> resolveCommandPacket(
|
||||||
|
const RawPacketType& rawPacket
|
||||||
|
) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::optional<TargetDescriptor> gdbTargetDescriptor;
|
std::optional<TargetDescriptor> gdbTargetDescriptor;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user