Set stale data flag in TargetMemoryInspectionPane, when the relevant memory type has been written to
This commit is contained in:
@@ -90,6 +90,10 @@ namespace Bloom
|
||||
std::bind(&Insight::onTargetRegistersWrittenEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener.registerCallbackForEventType<Events::MemoryWrittenToTarget>(
|
||||
std::bind(&Insight::onTargetMemoryWrittenEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener.registerCallbackForEventType<Events::ProgrammingModeEnabled>(
|
||||
std::bind(&Insight::onProgrammingModeEnabledEvent, this, std::placeholders::_1)
|
||||
);
|
||||
@@ -338,6 +342,13 @@ namespace Bloom
|
||||
emit this->insightSignals->targetRegistersWritten(event.registers, event.createdTimestamp);
|
||||
}
|
||||
|
||||
void Insight::onTargetMemoryWrittenEvent(const Events::MemoryWrittenToTarget& event) {
|
||||
emit this->insightSignals->targetMemoryWritten(
|
||||
event.memoryType,
|
||||
Targets::TargetMemoryAddressRange(event.startAddress, event.startAddress + (event.size - 1))
|
||||
);
|
||||
}
|
||||
|
||||
void Insight::onTargetControllerStateChangedEvent(const Events::TargetControllerStateChanged& event) {
|
||||
using TargetController::TargetControllerState;
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ namespace Bloom
|
||||
void onTargetResumedEvent(const Events::TargetExecutionResumed& event);
|
||||
void onTargetResetEvent(const Events::TargetReset& event);
|
||||
void onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event);
|
||||
void onTargetMemoryWrittenEvent(const Events::MemoryWrittenToTarget& event);
|
||||
void onTargetControllerStateChangedEvent(const Events::TargetControllerStateChanged& event);
|
||||
void onProgrammingModeEnabledEvent(const Events::ProgrammingModeEnabled& event);
|
||||
void onProgrammingModeDisabledEvent(const Events::ProgrammingModeDisabled& event);
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace Bloom
|
||||
void targetStateUpdated(Bloom::Targets::TargetState newState);
|
||||
void targetReset();
|
||||
void targetRegistersWritten(const Bloom::Targets::TargetRegisters& targetRegisters, const QDateTime& timestamp);
|
||||
void targetMemoryWritten(Bloom::Targets::TargetMemoryType memoryType, Targets::TargetMemoryAddressRange addressRange);
|
||||
void targetControllerSuspended();
|
||||
void targetControllerResumed(const Bloom::Targets::TargetDescriptor& targetDescriptor);
|
||||
void programmingModeEnabled();
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace Bloom::Widgets
|
||||
|
||||
using Bloom::Targets::TargetMemoryDescriptor;
|
||||
using Bloom::Targets::TargetMemoryType;
|
||||
using Bloom::Targets::TargetMemoryAddressRange;
|
||||
|
||||
TargetMemoryInspectionPane::TargetMemoryInspectionPane(
|
||||
const TargetMemoryDescriptor& targetMemoryDescriptor,
|
||||
@@ -213,6 +214,13 @@ namespace Bloom::Widgets
|
||||
&TargetMemoryInspectionPane::onProgrammingModeDisabled
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
insightSignals,
|
||||
&InsightSignals::targetMemoryWritten,
|
||||
this,
|
||||
&TargetMemoryInspectionPane::onTargetMemoryWritten
|
||||
);
|
||||
|
||||
// Restore the state
|
||||
if (this->state.attached) {
|
||||
this->attach();
|
||||
@@ -511,6 +519,15 @@ namespace Bloom::Widgets
|
||||
this->refreshButton->setDisabled(disabled);
|
||||
}
|
||||
|
||||
void TargetMemoryInspectionPane::onTargetMemoryWritten(
|
||||
TargetMemoryType memoryType,
|
||||
TargetMemoryAddressRange addressRange
|
||||
) {
|
||||
if (memoryType == this->targetMemoryDescriptor.type) {
|
||||
this->setStaleData(this->data.has_value());
|
||||
}
|
||||
}
|
||||
|
||||
void TargetMemoryInspectionPane::setStaleData(bool staleData) {
|
||||
this->staleData = staleData;
|
||||
this->staleDataLabelContainer->setVisible(this->staleData);
|
||||
|
||||
@@ -80,6 +80,10 @@ namespace Bloom::Widgets
|
||||
void onTargetReset();
|
||||
void onProgrammingModeEnabled();
|
||||
void onProgrammingModeDisabled();
|
||||
void onTargetMemoryWritten(
|
||||
Bloom::Targets::TargetMemoryType memoryType,
|
||||
Targets::TargetMemoryAddressRange addressRange
|
||||
);
|
||||
void setStaleData(bool staleData);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user