Renamed GdbRsp directory to Gdb
This commit is contained in:
47
src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp
Normal file
47
src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user