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:
@@ -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,
|
||||
|
||||
29
src/TargetController/Commands/GetState.hpp
Normal file
29
src/TargetController/Commands/GetState.hpp
Normal 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;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user