Restricted memory access member function to system address space, in RISC-V debug translator
This commit is contained in:
@@ -77,6 +77,7 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
|
|||||||
, config(config)
|
, config(config)
|
||||||
, targetDescriptionFile(targetDescriptionFile)
|
, targetDescriptionFile(targetDescriptionFile)
|
||||||
, targetConfig(targetConfig)
|
, targetConfig(targetConfig)
|
||||||
|
, sysAddressSpaceDescriptor(targetDescriptionFile.getSystemAddressSpaceDescriptor())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void DebugTranslator::activate() {
|
void DebugTranslator::activate() {
|
||||||
@@ -437,6 +438,10 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
|
|||||||
TargetMemorySize bytes,
|
TargetMemorySize bytes,
|
||||||
const std::set<TargetMemoryAddressRange>& excludedAddressRanges
|
const std::set<TargetMemoryAddressRange>& excludedAddressRanges
|
||||||
) {
|
) {
|
||||||
|
if (addressSpaceDescriptor != this->sysAddressSpaceDescriptor) {
|
||||||
|
throw Exceptions::TargetOperationFailure{"Unsupported address space"};
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: excluded addresses
|
// TODO: excluded addresses
|
||||||
|
|
||||||
constexpr auto alignTo = DebugTranslator::WORD_BYTE_SIZE;
|
constexpr auto alignTo = DebugTranslator::WORD_BYTE_SIZE;
|
||||||
@@ -474,6 +479,10 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
|
|||||||
TargetMemoryAddress startAddress,
|
TargetMemoryAddress startAddress,
|
||||||
TargetMemoryBufferSpan buffer
|
TargetMemoryBufferSpan buffer
|
||||||
) {
|
) {
|
||||||
|
if (addressSpaceDescriptor != this->sysAddressSpaceDescriptor) {
|
||||||
|
throw Exceptions::TargetOperationFailure{"Unsupported address space"};
|
||||||
|
}
|
||||||
|
|
||||||
constexpr auto alignTo = DebugTranslator::WORD_BYTE_SIZE;
|
constexpr auto alignTo = DebugTranslator::WORD_BYTE_SIZE;
|
||||||
const auto bytes = static_cast<TargetMemorySize>(buffer.size());
|
const auto bytes = static_cast<TargetMemorySize>(buffer.size());
|
||||||
if ((startAddress % alignTo) != 0 || (bytes % alignTo) != 0) {
|
if ((startAddress % alignTo) != 0 || (bytes % alignTo) != 0) {
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
|
|||||||
const ::Targets::RiscV::TargetDescriptionFile& targetDescriptionFile;
|
const ::Targets::RiscV::TargetDescriptionFile& targetDescriptionFile;
|
||||||
const ::Targets::RiscV::RiscVTargetConfig& targetConfig;
|
const ::Targets::RiscV::RiscVTargetConfig& targetConfig;
|
||||||
|
|
||||||
|
const ::Targets::TargetAddressSpaceDescriptor sysAddressSpaceDescriptor;
|
||||||
|
|
||||||
DebugModuleDescriptor debugModuleDescriptor = {};
|
DebugModuleDescriptor debugModuleDescriptor = {};
|
||||||
|
|
||||||
DebugModule::HartIndex selectedHartIndex = 0;
|
DebugModule::HartIndex selectedHartIndex = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user