Tidying
This commit is contained in:
@@ -493,11 +493,11 @@ namespace DebugServer::Gdb
|
|||||||
return std::make_unique<CommandPackets::WriteRegisterMonitor>(std::move(*(monitorCommand.release())));
|
return std::make_unique<CommandPackets::WriteRegisterMonitor>(std::move(*(monitorCommand.release())));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef EXCLUDE_INSIGHT
|
#ifndef EXCLUDE_INSIGHT
|
||||||
if (monitorCommand->command.find("insight") == 0) {
|
if (monitorCommand->command.find("insight") == 0) {
|
||||||
return std::make_unique<CommandPackets::ActivateInsight>(std::move(*(monitorCommand.release())));
|
return std::make_unique<CommandPackets::ActivateInsight>(std::move(*(monitorCommand.release())));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return monitorCommand;
|
return monitorCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
#include "TriggerModule/Registers/TriggerData1.hpp"
|
#include "TriggerModule/Registers/TriggerData1.hpp"
|
||||||
#include "TriggerModule/Registers/MatchControl.hpp"
|
#include "TriggerModule/Registers/MatchControl.hpp"
|
||||||
|
|
||||||
|
#include "src/Helpers/Array.hpp"
|
||||||
|
|
||||||
#include "src/Exceptions/Exception.hpp"
|
#include "src/Exceptions/Exception.hpp"
|
||||||
#include "src/Exceptions/InvalidConfig.hpp"
|
#include "src/Exceptions/InvalidConfig.hpp"
|
||||||
#include "src/Exceptions/InternalFatalErrorException.hpp"
|
#include "src/Exceptions/InternalFatalErrorException.hpp"
|
||||||
@@ -526,9 +528,10 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->writeProgramBuffer(
|
static constexpr auto clearedBuffer = Array::repeat<DebugTranslator::MAX_PROGRAM_BUFFER_SIZE>(Opcodes::Ebreak);
|
||||||
std::vector<Opcodes::Opcode>(this->debugModuleDescriptor.programBufferSize, Opcodes::Ebreak)
|
|
||||||
);
|
assert(this->debugModuleDescriptor.programBufferSize <= DebugTranslator::MAX_PROGRAM_BUFFER_SIZE);
|
||||||
|
this->writeProgramBuffer({clearedBuffer.begin(), this->debugModuleDescriptor.programBufferSize});
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugTranslator::executeFenceProgram() {
|
void DebugTranslator::executeFenceProgram() {
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
|
|||||||
private:
|
private:
|
||||||
static constexpr auto DEBUG_MODULE_RESPONSE_DELAY = std::chrono::microseconds{10};
|
static constexpr auto DEBUG_MODULE_RESPONSE_DELAY = std::chrono::microseconds{10};
|
||||||
static constexpr auto WORD_BYTE_SIZE = ::Targets::TargetMemorySize{4};
|
static constexpr auto WORD_BYTE_SIZE = ::Targets::TargetMemorySize{4};
|
||||||
|
static constexpr auto MAX_PROGRAM_BUFFER_SIZE = std::uint8_t{16};
|
||||||
|
|
||||||
DebugTransportModuleInterface& dtmInterface;
|
DebugTransportModuleInterface& dtmInterface;
|
||||||
const DebugTranslatorConfig& config;
|
const DebugTranslatorConfig& config;
|
||||||
|
|||||||
16
src/Helpers/Array.hpp
Normal file
16
src/Helpers/Array.hpp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
#include <concepts>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
class Array
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
template<std::size_t size, std::semiregular ValueType>
|
||||||
|
static constexpr auto repeat(const ValueType& value) {
|
||||||
|
auto output = std::array<ValueType, size>{};
|
||||||
|
output.fill(value);
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user