Renamed GdbRsp directory to Gdb

This commit is contained in:
Nav
2022-03-31 21:52:46 +01:00
parent 01d52bb130
commit 2aa240a680
57 changed files with 64 additions and 64 deletions

View File

@@ -0,0 +1,47 @@
#include "AvrGdbRsp.hpp"
// Command packets
#include "CommandPackets/ReadMemory.hpp"
#include "CommandPackets/WriteMemory.hpp"
namespace Bloom::DebugServer::Gdb::AvrGdb
{
using namespace Bloom::Exceptions;
using Bloom::Targets::TargetRegisterDescriptor;
using Bloom::Targets::TargetRegisterType;
AvrGdbRsp::AvrGdbRsp(
const DebugServerConfig& debugServerConfig,
EventListener& eventListener
)
: GdbRspDebugServer(debugServerConfig, eventListener)
{}
void AvrGdbRsp::init() {
DebugServer::Gdb::GdbRspDebugServer::init();
this->gdbTargetDescriptor = TargetDescriptor(
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);
}
}