Moved GDB command packet handling to individual CommandPacket classes

This commit is contained in:
Nav
2022-03-24 19:17:41 +00:00
parent df5a904a43
commit 2b3a6fd27f
31 changed files with 582 additions and 583 deletions

View File

@@ -4,10 +4,9 @@
#include <memory>
#include "src/DebugServers/GdbRsp/Packet.hpp"
#include "src/DebugServers/GdbRsp/DebugSession.hpp"
namespace Bloom::DebugServers::Gdb {
class GdbRspDebugServer;
}
#include "src/TargetController/TargetControllerConsole.hpp"
namespace Bloom::DebugServers::Gdb::CommandPackets
{
@@ -40,12 +39,13 @@ namespace Bloom::DebugServers::Gdb::CommandPackets
explicit CommandPacket(const std::vector<unsigned char>& rawPacket): Packet(rawPacket) {}
/**
* Double dispatches the packet to the appropriate overload of handleGdbPacket(), within the passed instance of
* GdbRspDebugServer. If there is no overload defined for a specific CommandPacket-inherited type, the
* generic GdbRspDebugServer::handleGdbPacket(CommandPacket&) is used.
* Should handle the command for the current active debug session.
*
* @param gdbRspDebugServer
* @param debugSession
* The current active debug session.
*
* @param targetControllerConsole
*/
virtual void dispatchToHandler(Gdb::GdbRspDebugServer& gdbRspDebugServer);
virtual void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole);
};
}