Updated MemoryInspectionPane to prevent it from enabling UI too early (before stack pointer retrieval) for RAM

This commit is contained in:
Nav
2022-07-24 12:44:31 +01:00
parent 8a047eb6ac
commit 08977e8e0c

View File

@@ -212,7 +212,7 @@ namespace Bloom::Widgets
readMemoryTask, readMemoryTask,
&ReadTargetMemory::targetMemoryRead, &ReadTargetMemory::targetMemoryRead,
this, this,
[this] (const Targets::TargetMemoryBuffer& data) { [this, callback] (const Targets::TargetMemoryBuffer& data) {
this->onMemoryRead(data); this->onMemoryRead(data);
// Refresh the stack pointer if this is RAM. // Refresh the stack pointer if this is RAM.
@@ -227,31 +227,56 @@ namespace Bloom::Widgets
} }
); );
QObject::connect(
readStackPointerTask,
&InsightWorkerTask::finished,
this,
[this] {
this->refreshButton->stopSpin();
if (this->targetState == Targets::TargetState::STOPPED) {
this->refreshButton->setDisabled(false);
}
}
);
if (callback.has_value()) {
QObject::connect(
readStackPointerTask,
&InsightWorkerTask::completed,
this,
callback.value()
);
}
this->insightWorker.queueTask(readStackPointerTask); this->insightWorker.queueTask(readStackPointerTask);
} }
} }
); );
QObject::connect( // If we're refreshing RAM, the UI should only be updated once we've retrieved the current stack pointer.
readMemoryTask, if (this->targetMemoryDescriptor.type != Targets::TargetMemoryType::RAM) {
&InsightWorkerTask::finished,
this,
[this] {
this->refreshButton->stopSpin();
if (this->targetState == Targets::TargetState::STOPPED) {
this->refreshButton->setDisabled(false);
}
}
);
if (callback.has_value()) {
QObject::connect( QObject::connect(
readMemoryTask, readMemoryTask,
&InsightWorkerTask::completed, &InsightWorkerTask::finished,
this, this,
callback.value() [this] {
this->refreshButton->stopSpin();
if (this->targetState == Targets::TargetState::STOPPED) {
this->refreshButton->setDisabled(false);
}
}
); );
if (callback.has_value()) {
QObject::connect(
readMemoryTask,
&InsightWorkerTask::completed,
this,
callback.value()
);
}
} }
this->insightWorker.queueTask(readMemoryTask); this->insightWorker.queueTask(readMemoryTask);