Added support for flash memory inspection
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "InsightWorkerTask.hpp"
|
||||
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
#include "src/Helpers/EnumToStringMappings.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
@@ -26,7 +27,7 @@ namespace Bloom
|
||||
{}
|
||||
|
||||
QString brief() const override {
|
||||
return "Reading target " + QString(this->memoryType == Targets::TargetMemoryType::EEPROM ? "EEPROM" : "RAM");
|
||||
return "Reading target " + EnumToStringMappings::targetMemoryTypes.at(this->memoryType).toUpper();
|
||||
}
|
||||
|
||||
TaskGroups taskGroups() const override {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.hpp"
|
||||
#include "src/Helpers/EnumToStringMappings.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
@@ -17,7 +18,7 @@ namespace Bloom
|
||||
RetrieveMemorySnapshots(Targets::TargetMemoryType memoryType);
|
||||
|
||||
QString brief() const override {
|
||||
return "Loading saved " + QString(this->memoryType == Targets::TargetMemoryType::EEPROM ? "EEPROM" : "RAM")
|
||||
return "Loading saved " + EnumToStringMappings::targetMemoryTypes.at(this->memoryType).toUpper()
|
||||
+ " memory snapshots";
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
using Services::TargetControllerService;
|
||||
@@ -11,6 +13,10 @@ namespace Bloom
|
||||
void WriteTargetMemory::run(TargetControllerService& targetControllerService) {
|
||||
using Targets::TargetMemorySize;
|
||||
|
||||
if (!this->memoryDescriptor.access.writeableDuringDebugSession) {
|
||||
throw Exceptions::Exception("Invalid request - cannot write to this memory type during a debug session.");
|
||||
}
|
||||
|
||||
/*
|
||||
* To prevent locking up the TargetController for too long, we split the write operation into numerous
|
||||
* operations.
|
||||
@@ -20,7 +26,7 @@ namespace Bloom
|
||||
*/
|
||||
const auto maxBlockSize = std::max(
|
||||
TargetMemorySize(256),
|
||||
memoryDescriptor.pageSize.value_or(TargetMemorySize(0))
|
||||
this->memoryDescriptor.pageSize.value_or(TargetMemorySize(0))
|
||||
);
|
||||
|
||||
const TargetMemorySize totalBytesToWrite = std::accumulate(
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "InsightWorkerTask.hpp"
|
||||
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
#include "src/Helpers/EnumToStringMappings.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
@@ -48,8 +49,9 @@ namespace Bloom
|
||||
|
||||
QString brief() const override {
|
||||
return
|
||||
"Writing to target "
|
||||
+ QString(this->memoryDescriptor.type == Targets::TargetMemoryType::EEPROM ? "EEPROM" : "RAM");
|
||||
"Writing to target " + EnumToStringMappings::targetMemoryTypes.at(
|
||||
this->memoryDescriptor.type
|
||||
).toUpper();
|
||||
}
|
||||
|
||||
TaskGroups taskGroups() const override {
|
||||
|
||||
Reference in New Issue
Block a user