#pragma once #include #include // Command packets #include "CommandPacket.hpp" #include "InterruptExecution.hpp" #include "SupportedFeaturesQuery.hpp" #include "ReadGeneralRegisters.hpp" #include "WriteGeneralRegisters.hpp" #include "ReadMemory.hpp" #include "WriteMemory.hpp" #include "StepExecution.hpp" #include "ContinueExecution.hpp" #include "SetBreakpoint.hpp" #include "RemoveBreakpoint.hpp" namespace Bloom::DebugServers::Gdb { using namespace CommandPackets; /** * The CommandPacketFactory class provides a means for extracting raw packet data from a raw buffer, and * constructing the appropriate CommandPacket objects. */ class CommandPacketFactory { public: /** * Extracts raw GDB RSP packets from buffer. * * @param buffer * The buffer from which to extract the raw GDB RSP packets. * * @return * A vector of raw packets. */ static std::vector> extractRawPackets(std::vector buffer); /** * Constructs the appropriate CommandPacket object from a single raw GDB RSP packet. * * @param rawPacket * The raw GDB RSP packet from which to construct the CommandPacket object. * * @return */ static std::unique_ptr create(std::vector rawPacket); }; }