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:
@@ -8,6 +8,7 @@ namespace Bloom::TargetController::Responses
|
||||
{
|
||||
GENERIC,
|
||||
ERROR,
|
||||
STATE,
|
||||
TARGET_DESCRIPTOR,
|
||||
TARGET_REGISTERS_READ,
|
||||
TARGET_MEMORY_READ,
|
||||
|
||||
24
src/TargetController/Responses/State.hpp
Normal file
24
src/TargetController/Responses/State.hpp
Normal 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;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user