Renamed SetProgramCounter TC command to SetTargetProgramCounter

This commit is contained in:
Nav
2022-05-01 18:47:57 +01:00
parent 4209d9eb20
commit fe846e0d7c
5 changed files with 15 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ namespace Bloom::TargetController::Commands
STEP_TARGET_EXECUTION, STEP_TARGET_EXECUTION,
SET_BREAKPOINT, SET_BREAKPOINT,
REMOVE_BREAKPOINT, REMOVE_BREAKPOINT,
SET_PROGRAM_COUNTER, SET_TARGET_PROGRAM_COUNTER,
GET_TARGET_PIN_STATES, GET_TARGET_PIN_STATES,
SET_TARGET_PIN_STATE, SET_TARGET_PIN_STATE,
GET_TARGET_STACK_POINTER, GET_TARGET_STACK_POINTER,

View File

@@ -8,20 +8,20 @@
namespace Bloom::TargetController::Commands namespace Bloom::TargetController::Commands
{ {
class SetProgramCounter: public Command class SetTargetProgramCounter: public Command
{ {
public: public:
static constexpr CommandType type = CommandType::SET_PROGRAM_COUNTER; static constexpr CommandType type = CommandType::SET_TARGET_PROGRAM_COUNTER;
static inline const std::string name = "SetProgramCounter"; static inline const std::string name = "SetTargetProgramCounter";
std::uint32_t address = 0; std::uint32_t address = 0;
explicit SetProgramCounter(std::uint32_t address) explicit SetTargetProgramCounter(std::uint32_t address)
: address(address) : address(address)
{}; {};
[[nodiscard]] CommandType getType() const override { [[nodiscard]] CommandType getType() const override {
return SetProgramCounter::type; return SetTargetProgramCounter::type;
} }
[[nodiscard]] bool requiresStoppedTargetState() const override { [[nodiscard]] bool requiresStoppedTargetState() const override {

View File

@@ -34,7 +34,7 @@ namespace Bloom::TargetController
using Commands::StepTargetExecution; using Commands::StepTargetExecution;
using Commands::SetBreakpoint; using Commands::SetBreakpoint;
using Commands::RemoveBreakpoint; using Commands::RemoveBreakpoint;
using Commands::SetProgramCounter; using Commands::SetTargetProgramCounter;
using Commands::GetTargetPinStates; using Commands::GetTargetPinStates;
using Commands::SetTargetPinState; using Commands::SetTargetPinState;
using Commands::GetTargetStackPointer; using Commands::GetTargetStackPointer;
@@ -408,7 +408,7 @@ namespace Bloom::TargetController
this->deregisterCommandHandler(StepTargetExecution::type); this->deregisterCommandHandler(StepTargetExecution::type);
this->deregisterCommandHandler(SetBreakpoint::type); this->deregisterCommandHandler(SetBreakpoint::type);
this->deregisterCommandHandler(RemoveBreakpoint::type); this->deregisterCommandHandler(RemoveBreakpoint::type);
this->deregisterCommandHandler(SetProgramCounter::type); this->deregisterCommandHandler(SetTargetProgramCounter::type);
this->deregisterCommandHandler(GetTargetPinStates::type); this->deregisterCommandHandler(GetTargetPinStates::type);
this->deregisterCommandHandler(SetTargetPinState::type); this->deregisterCommandHandler(SetTargetPinState::type);
this->deregisterCommandHandler(GetTargetStackPointer::type); this->deregisterCommandHandler(GetTargetStackPointer::type);
@@ -479,7 +479,7 @@ namespace Bloom::TargetController
std::bind(&TargetControllerComponent::handleRemoveBreakpoint, this, std::placeholders::_1) std::bind(&TargetControllerComponent::handleRemoveBreakpoint, this, std::placeholders::_1)
); );
this->registerCommandHandler<SetProgramCounter>( this->registerCommandHandler<SetTargetProgramCounter>(
std::bind(&TargetControllerComponent::handleSetProgramCounter, this, std::placeholders::_1) std::bind(&TargetControllerComponent::handleSetProgramCounter, this, std::placeholders::_1)
); );
@@ -883,7 +883,7 @@ namespace Bloom::TargetController
return std::make_unique<Response>(); return std::make_unique<Response>();
} }
std::unique_ptr<Response> TargetControllerComponent::handleSetProgramCounter(SetProgramCounter& command) { std::unique_ptr<Response> TargetControllerComponent::handleSetProgramCounter(SetTargetProgramCounter& command) {
this->target->setProgramCounter(command.address); this->target->setProgramCounter(command.address);
return std::make_unique<Response>(); return std::make_unique<Response>();
} }

View File

@@ -30,7 +30,7 @@
#include "Commands/StepTargetExecution.hpp" #include "Commands/StepTargetExecution.hpp"
#include "Commands/SetBreakpoint.hpp" #include "Commands/SetBreakpoint.hpp"
#include "Commands/RemoveBreakpoint.hpp" #include "Commands/RemoveBreakpoint.hpp"
#include "Commands/SetProgramCounter.hpp" #include "Commands/SetTargetProgramCounter.hpp"
#include "Commands/GetTargetPinStates.hpp" #include "Commands/GetTargetPinStates.hpp"
#include "Commands/SetTargetPinState.hpp" #include "Commands/SetTargetPinState.hpp"
#include "Commands/GetTargetStackPointer.hpp" #include "Commands/GetTargetStackPointer.hpp"
@@ -314,7 +314,7 @@ namespace Bloom::TargetController
std::unique_ptr<Responses::Response> handleStepTargetExecution(Commands::StepTargetExecution& command); std::unique_ptr<Responses::Response> handleStepTargetExecution(Commands::StepTargetExecution& command);
std::unique_ptr<Responses::Response> handleSetBreakpoint(Commands::SetBreakpoint& command); std::unique_ptr<Responses::Response> handleSetBreakpoint(Commands::SetBreakpoint& command);
std::unique_ptr<Responses::Response> handleRemoveBreakpoint(Commands::RemoveBreakpoint& command); std::unique_ptr<Responses::Response> handleRemoveBreakpoint(Commands::RemoveBreakpoint& command);
std::unique_ptr<Responses::Response> handleSetProgramCounter(Commands::SetProgramCounter& command); std::unique_ptr<Responses::Response> handleSetProgramCounter(Commands::SetTargetProgramCounter& command);
std::unique_ptr<Responses::TargetPinStates> handleGetTargetPinStates(Commands::GetTargetPinStates& command); std::unique_ptr<Responses::TargetPinStates> handleGetTargetPinStates(Commands::GetTargetPinStates& command);
std::unique_ptr<Responses::Response> handleSetTargetPinState(Commands::SetTargetPinState& command); std::unique_ptr<Responses::Response> handleSetTargetPinState(Commands::SetTargetPinState& command);
std::unique_ptr<Responses::TargetStackPointer> handleGetTargetStackPointer( std::unique_ptr<Responses::TargetStackPointer> handleGetTargetStackPointer(

View File

@@ -17,7 +17,7 @@
#include "Commands/StepTargetExecution.hpp" #include "Commands/StepTargetExecution.hpp"
#include "Commands/SetBreakpoint.hpp" #include "Commands/SetBreakpoint.hpp"
#include "Commands/RemoveBreakpoint.hpp" #include "Commands/RemoveBreakpoint.hpp"
#include "Commands/SetProgramCounter.hpp" #include "Commands/SetTargetProgramCounter.hpp"
#include "Commands/GetTargetPinStates.hpp" #include "Commands/GetTargetPinStates.hpp"
#include "Commands/SetTargetPinState.hpp" #include "Commands/SetTargetPinState.hpp"
#include "Commands/GetTargetStackPointer.hpp" #include "Commands/GetTargetStackPointer.hpp"
@@ -43,7 +43,7 @@ namespace Bloom::TargetController
using Commands::StepTargetExecution; using Commands::StepTargetExecution;
using Commands::SetBreakpoint; using Commands::SetBreakpoint;
using Commands::RemoveBreakpoint; using Commands::RemoveBreakpoint;
using Commands::SetProgramCounter; using Commands::SetTargetProgramCounter;
using Commands::GetTargetPinStates; using Commands::GetTargetPinStates;
using Commands::SetTargetPinState; using Commands::SetTargetPinState;
using Commands::GetTargetStackPointer; using Commands::GetTargetStackPointer;
@@ -178,7 +178,7 @@ namespace Bloom::TargetController
void TargetControllerConsole::setProgramCounter(std::uint32_t address) { void TargetControllerConsole::setProgramCounter(std::uint32_t address) {
this->commandManager.sendCommandAndWaitForResponse( this->commandManager.sendCommandAndWaitForResponse(
std::make_unique<SetProgramCounter>(address), std::make_unique<SetTargetProgramCounter>(address),
this->defaultTimeout this->defaultTimeout
); );
} }