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

@@ -2,11 +2,9 @@
#include <optional>
#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp"
#include "CommandPacket.hpp"
#include "src/DebugServer/Gdb/RegisterDescriptor.hpp"
#include "src/DebugServer/Gdb/AvrGdb/TargetDescriptor.hpp"
#include "src/Targets/TargetMemorySegmentDescriptor.hpp"
namespace DebugServer::Gdb::AvrGdb::CommandPackets
{
@@ -14,16 +12,14 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
* The ReadRegisters class implements a structure for the "g" command packet. In response to this packet, the
* server is expected to send register values for all registers.
*/
class ReadRegisters: public Gdb::CommandPackets::CommandPacket
class ReadRegisters: public CommandPackets::CommandPacket
{
public:
const Targets::TargetMemorySegmentDescriptor& gpRegistersMemorySegmentDescriptor;
explicit ReadRegisters(const RawPacket& rawPacket, const TargetDescriptor& gdbTargetDescriptor);
explicit ReadRegisters(const RawPacket& rawPacket);
void handle(
Gdb::DebugSession& debugSession,
const Gdb::TargetDescriptor& gdbTargetDescriptor,
DebugSession& debugSession,
const AvrGdbTargetDescriptor& gdbTargetDescriptor,
const Targets::TargetDescriptor& targetDescriptor,
Services::TargetControllerService& targetControllerService
) override;