Replaced static TargetController state object access with new GetState command

This corrects a bug where the DebugServer checks if the TargetController is in
service just before it's about to suspend. The DebugServer then attempts to start
a new debug session, only for the TargetController to go into a suspended state.
A fatal error occurs and a shutdown follows. This bug is only apparent when
the user stops and starts debug sessions very quickly, with releasePostDebugSession
set to true.
This commit is contained in:
Nav
2022-08-14 17:44:52 +01:00
parent 0665ef2927
commit c4bcf71424
7 changed files with 73 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ namespace Bloom::TargetController::Commands
enum class CommandType: std::uint8_t
{
GENERIC,
GET_STATE,
GET_TARGET_DESCRIPTOR,
STOP_TARGET_EXECUTION,
RESUME_TARGET_EXECUTION,

View File

@@ -0,0 +1,29 @@
#pragma once
#include "Command.hpp"
#include "src/TargetController/Responses/State.hpp"
namespace Bloom::TargetController::Commands
{
class GetState: public Command
{
public:
using SuccessResponseType = Responses::State;
static constexpr CommandType type = CommandType::GET_STATE;
static inline const std::string name = "GetState";
[[nodiscard]] CommandType getType() const override {
return GetState::type;
}
[[nodiscard]] bool requiresActiveState() const override {
return false;
}
[[nodiscard]] bool requiresDebugMode() const override {
return false;
}
};
}