Triggering a registers written event when a memory range that contains a register is written to.

This commit is contained in:
Nav
2021-09-11 20:39:31 +01:00
parent b8bf590be7
commit 12a7d58b59
4 changed files with 161 additions and 5 deletions

View File

@@ -13,6 +13,8 @@
#include "src/DebugToolDrivers/DebugTools.hpp"
#include "src/Targets/Target.hpp"
#include "src/Targets/Targets.hpp"
#include "src/Targets/TargetRegister.hpp"
#include "src/Targets/TargetMemory.hpp"
#include "src/EventManager/EventManager.hpp"
#include "src/EventManager/EventListener.hpp"
@@ -65,6 +67,16 @@ namespace Bloom
*/
std::optional<Targets::TargetDescriptor> cachedTargetDescriptor;
/**
* Target register descriptors mapped by the memory type on which the register is stored.
*/
std::map<Targets::TargetMemoryType, Targets::TargetRegisterDescriptors> registerDescriptorsByMemoryType;
/**
* Memory address ranges for target registers, mapped by the register memory type.
*/
std::map<Targets::TargetMemoryType, Targets::TargetMemoryAddressRange> registerAddressRangeByMemoryType;
/**
* Constructs a mapping of supported debug tool names to lambdas. The lambdas should *only* instantiate
* and return an instance to the derived DebugTool class. They should not attempt to establish
@@ -210,6 +222,25 @@ namespace Bloom
*/
void resume();
/**
* Extracts address ranges and groups target register descriptors.
*/
void loadRegisterDescriptors();
/**
* Resolves the descriptors of all target registers found within the given address range and memory type.
*
* @param startAddress
* @param endAddress
* @param memoryType
* @return
*/
Targets::TargetRegisterDescriptors getRegisterDescriptorsWithinAddressRange(
std::uint32_t startAddress,
std::uint32_t endAddress,
Targets::TargetMemoryType memoryType
);
/**
* Should fire any events queued on the target.
*/
@@ -223,6 +254,8 @@ namespace Bloom
*/
void emitErrorEvent(int correlationId);
Targets::TargetDescriptor& getTargetDescriptor();
public:
explicit TargetController(EventManager& eventManager): eventManager(eventManager) {};