From 226b663aeaca18d0889b4cfcd57e5ab240fc619c Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 30 Apr 2022 16:22:51 +0100 Subject: [PATCH] Moved responsibility of stopping and resetting the target at the beginning of the debug session to the DebugServer. --- src/DebugServer/Gdb/GdbRspDebugServer.cpp | 3 +++ src/TargetController/TargetControllerComponent.cpp | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/DebugServer/Gdb/GdbRspDebugServer.cpp b/src/DebugServer/Gdb/GdbRspDebugServer.cpp index b42851e9..f9d75a62 100644 --- a/src/DebugServer/Gdb/GdbRspDebugServer.cpp +++ b/src/DebugServer/Gdb/GdbRspDebugServer.cpp @@ -173,6 +173,9 @@ namespace Bloom::DebugServer::Gdb throw DebugSessionAborted("TargetController not in service"); } } + + this->targetControllerConsole.stopTargetExecution(); + this->targetControllerConsole.resetTarget(); } auto commandPacket = this->waitForCommandPacket(); diff --git a/src/TargetController/TargetControllerComponent.cpp b/src/TargetController/TargetControllerComponent.cpp index 1f60ce5a..2c7250d4 100644 --- a/src/TargetController/TargetControllerComponent.cpp +++ b/src/TargetController/TargetControllerComponent.cpp @@ -717,12 +717,6 @@ namespace Bloom::TargetController this->resume(); this->fireTargetEvents(); } - - this->resetTarget(); - - if (this->target->getState() != TargetState::STOPPED) { - this->target->stop(); - } } void TargetControllerComponent::onDebugSessionFinishedEvent(const DebugSessionFinished&) {