Made VCont step/continue command handlers generic (non-target-specific)

This commit is contained in:
Nav
2024-10-25 23:12:04 +01:00
parent 8be311cbc0
commit 9df41ccfc5
7 changed files with 22 additions and 24 deletions

View File

@@ -13,8 +13,6 @@
#include "CommandPackets/FlashWrite.hpp"
#include "CommandPackets/FlashDone.hpp"
#include "CommandPackets/VContSupportedActionsQuery.hpp"
#include "CommandPackets/VContContinueExecution.hpp"
#include "CommandPackets/VContStepExecution.hpp"
#include "CommandPackets/VContRangeStep.hpp"
#include "src/DebugServer/Gdb/CommandPackets/Monitor.hpp"
@@ -56,8 +54,6 @@ namespace DebugServer::Gdb::AvrGdb
using CommandPackets::FlashWrite;
using CommandPackets::FlashDone;
using CommandPackets::VContSupportedActionsQuery;
using CommandPackets::VContContinueExecution;
using CommandPackets::VContStepExecution;
using CommandPackets::VContRangeStep;
using CommandPackets::EepromFill;
@@ -108,14 +104,6 @@ namespace DebugServer::Gdb::AvrGdb
return std::make_unique<VContSupportedActionsQuery>(rawPacket);
}
if (rawPacketString.find("vCont;c") == 0 || rawPacketString.find("vCont;C") == 0) {
return std::make_unique<VContContinueExecution>(rawPacket);
}
if (rawPacketString.find("vCont;s") == 0 || rawPacketString.find("vCont;S") == 0) {
return std::make_unique<VContStepExecution>(rawPacket);
}
if (this->debugServerConfig.rangeStepping) {
if (rawPacketString.find("vCont;r") == 0) {
return std::make_unique<VContRangeStep>(rawPacket);

View File

@@ -2,7 +2,7 @@
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
namespace DebugServer::Gdb::AvrGdb::CommandPackets
namespace DebugServer::Gdb::CommandPackets
{
using Services::TargetControllerService;
@@ -16,7 +16,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
void VContContinueExecution::handle(
DebugSession& debugSession,
const AvrGdbTargetDescriptor& gdbTargetDescriptor,
const TargetDescriptor& gdbTargetDescriptor,
const Targets::TargetDescriptor& targetDescriptor,
TargetControllerService& targetControllerService
) {

View File

@@ -4,20 +4,20 @@
#include "CommandPacket.hpp"
namespace DebugServer::Gdb::AvrGdb::CommandPackets
namespace DebugServer::Gdb::CommandPackets
{
/**
* The VContContinueExecution class implements a structure for "vCont;c" and "vCont;C" packets. These packets
* instruct the server to continue execution on the target.
*/
class VContContinueExecution: public CommandPackets::CommandPacket
class VContContinueExecution: public CommandPacket
{
public:
explicit VContContinueExecution(const RawPacket& rawPacket);
void handle(
DebugSession& debugSession,
const AvrGdbTargetDescriptor& gdbTargetDescriptor,
const TargetDescriptor& gdbTargetDescriptor,
const Targets::TargetDescriptor& targetDescriptor,
Services::TargetControllerService& targetControllerService
) override;

View File

@@ -2,7 +2,7 @@
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
namespace DebugServer::Gdb::AvrGdb::CommandPackets
namespace DebugServer::Gdb::CommandPackets
{
using Services::TargetControllerService;
@@ -16,7 +16,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
void VContStepExecution::handle(
DebugSession& debugSession,
const AvrGdbTargetDescriptor& gdbTargetDescriptor,
const TargetDescriptor& gdbTargetDescriptor,
const Targets::TargetDescriptor& targetDescriptor,
TargetControllerService& targetControllerService
) {

View File

@@ -4,19 +4,19 @@
#include "CommandPacket.hpp"
namespace DebugServer::Gdb::AvrGdb::CommandPackets
namespace DebugServer::Gdb::CommandPackets
{
/**
* The VContStepExecution class implements a structure for "vCont;s" and "vCont;S" packets.
*/
class VContStepExecution: public CommandPackets::CommandPacket
class VContStepExecution: public CommandPacket
{
public:
explicit VContStepExecution(const RawPacket& rawPacket);
void handle(
DebugSession& debugSession,
const AvrGdbTargetDescriptor& gdbTargetDescriptor,
const TargetDescriptor& gdbTargetDescriptor,
const Targets::TargetDescriptor& targetDescriptor,
Services::TargetControllerService& targetControllerService
) override;

View File

@@ -60,6 +60,8 @@
#include "CommandPackets/ListRegistersMonitor.hpp"
#include "CommandPackets/ReadRegistersMonitor.hpp"
#include "CommandPackets/WriteRegisterMonitor.hpp"
#include "CommandPackets/VContContinueExecution.hpp"
#include "CommandPackets/VContStepExecution.hpp"
#ifndef EXCLUDE_INSIGHT
#include "CommandPackets/ActivateInsight.hpp"
@@ -441,6 +443,14 @@ namespace DebugServer::Gdb
return std::make_unique<CommandPackets::SupportedFeaturesQuery>(rawPacket);
}
if (rawPacketString.find("vCont;c") == 0 || rawPacketString.find("vCont;C") == 0) {
return std::make_unique<CommandPackets::VContContinueExecution>(rawPacket);
}
if (rawPacketString.find("vCont;s") == 0 || rawPacketString.find("vCont;S") == 0) {
return std::make_unique<CommandPackets::VContStepExecution>(rawPacket);
}
if (rawPacketString.find("qRcmd") == 0) {
// This is a monitor packet
auto monitorCommand = std::make_unique<CommandPackets::Monitor>(rawPacket);