Preparation for support for the GDB vCont command packet
Also fixed a bug in the `StepExecution` and `ContinueExecution` constructors, where the from address wasn't being extracted properly
This commit is contained in:
@@ -14,11 +14,13 @@ namespace Bloom::TargetController::Commands
|
||||
static constexpr CommandType type = CommandType::RESUME_TARGET_EXECUTION;
|
||||
static const inline std::string name = "ResumeTargetExecution";
|
||||
|
||||
std::optional<Targets::TargetProgramCounter> fromProgramCounter;
|
||||
std::optional<Targets::TargetMemoryAddress> fromAddress;
|
||||
std::optional<Targets::TargetMemoryAddress> toAddress;
|
||||
|
||||
ResumeTargetExecution() = default;
|
||||
explicit ResumeTargetExecution(Targets::TargetProgramCounter fromProgramCounter)
|
||||
: fromProgramCounter(fromProgramCounter)
|
||||
ResumeTargetExecution(Targets::TargetMemoryAddress fromAddress, Targets::TargetMemoryAddress toAddress)
|
||||
: fromAddress(fromAddress)
|
||||
, toAddress(toAddress)
|
||||
{};
|
||||
|
||||
[[nodiscard]] CommandType getType() const override {
|
||||
|
||||
@@ -797,11 +797,11 @@ namespace Bloom::TargetController
|
||||
ResumeTargetExecution& command
|
||||
) {
|
||||
if (this->target->getState() != TargetState::RUNNING) {
|
||||
if (command.fromProgramCounter.has_value()) {
|
||||
this->target->setProgramCounter(command.fromProgramCounter.value());
|
||||
if (command.fromAddress.has_value()) {
|
||||
this->target->setProgramCounter(*command.fromAddress);
|
||||
}
|
||||
|
||||
this->target->run();
|
||||
this->target->run(command.toAddress);
|
||||
this->lastTargetState = TargetState::RUNNING;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user