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

@@ -8,6 +8,7 @@ namespace Bloom::TargetController::Responses
{
GENERIC,
ERROR,
STATE,
TARGET_DESCRIPTOR,
TARGET_REGISTERS_READ,
TARGET_MEMORY_READ,

View File

@@ -0,0 +1,24 @@
#pragma once
#include "Response.hpp"
#include "src/TargetController/TargetControllerState.hpp"
namespace Bloom::TargetController::Responses
{
class State: public Response
{
public:
static constexpr ResponseType type = ResponseType::STATE;
TargetControllerState state;
explicit State(TargetControllerState state)
: state(state)
{}
[[nodiscard]] ResponseType getType() const override {
return State::type;
}
};
}