From 33776a41cd716d94dd9c4398bb96cd5d26341a84 Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 3 Apr 2025 00:07:05 +0100 Subject: [PATCH] Fixed stale program counter bug --- src/Insight/Insight.cpp | 4 ---- src/TargetController/TargetControllerComponent.cpp | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index 30f65c91..e791b35a 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -186,10 +186,6 @@ void Insight::onTargetStateChangedEvent(const Events::TargetStateChanged& event) } } - if (event.previousState.executionState == event.newState.executionState) { - return; - } - emit this->insightSignals->targetStateUpdated(event.newState, event.previousState); } diff --git a/src/TargetController/TargetControllerComponent.cpp b/src/TargetController/TargetControllerComponent.cpp index a67734e3..6a40c859 100644 --- a/src/TargetController/TargetControllerComponent.cpp +++ b/src/TargetController/TargetControllerComponent.cpp @@ -1407,6 +1407,11 @@ namespace TargetController std::unique_ptr TargetControllerComponent::handleSetProgramCounter(SetTargetProgramCounter& command) { this->target->setProgramCounter(command.address); + + auto newState = *(this->targetState); + newState.programCounter = this->target->getProgramCounter(); + this->updateTargetState(newState); + return std::make_unique(); }