Refresh snapshot diff windows when comparing against current memory and the memory has been updated
This commit is contained in:
@@ -82,6 +82,25 @@ namespace Bloom::Widgets
|
|||||||
this->dataBSecondaryLabel->setVisible(false);
|
this->dataBSecondaryLabel->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SnapshotDiff::refreshB(
|
||||||
|
Targets::TargetMemoryBuffer data,
|
||||||
|
std::vector<FocusedMemoryRegion> focusedRegions,
|
||||||
|
std::vector<ExcludedMemoryRegion> excludedRegions,
|
||||||
|
Targets::TargetStackPointer stackPointer
|
||||||
|
) {
|
||||||
|
this->hexViewerDataB = data;
|
||||||
|
this->focusedRegionsB = focusedRegions;
|
||||||
|
this->excludedRegionsB = excludedRegions;
|
||||||
|
this->stackPointerB = stackPointer;
|
||||||
|
|
||||||
|
if (this->memoryDescriptor.type == Targets::TargetMemoryType::RAM) {
|
||||||
|
this->hexViewerWidgetB->setStackPointer(this->stackPointerB);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->hexViewerWidgetB->refreshRegions();
|
||||||
|
this->hexViewerWidgetB->updateValues();
|
||||||
|
}
|
||||||
|
|
||||||
void SnapshotDiff::showEvent(QShowEvent* event) {
|
void SnapshotDiff::showEvent(QShowEvent* event) {
|
||||||
QWidget::showEvent(event);
|
QWidget::showEvent(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,13 @@ namespace Bloom::Widgets
|
|||||||
QWidget* parent = nullptr
|
QWidget* parent = nullptr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void refreshB(
|
||||||
|
Targets::TargetMemoryBuffer data,
|
||||||
|
std::vector<FocusedMemoryRegion> focusedRegions,
|
||||||
|
std::vector<ExcludedMemoryRegion> excludedRegions,
|
||||||
|
Targets::TargetStackPointer stackPointer
|
||||||
|
);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent* event) override;
|
void showEvent(QShowEvent* event) override;
|
||||||
void resizeEvent(QResizeEvent* event) override;
|
void resizeEvent(QResizeEvent* event) override;
|
||||||
|
|||||||
@@ -239,6 +239,24 @@ namespace Bloom::Widgets
|
|||||||
this->show();
|
this->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SnapshotManager::onCurrentDataChanged() {
|
||||||
|
this->createSnapshotWindow->refreshForm();
|
||||||
|
|
||||||
|
if (!this->data.has_value()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Refresh the data in all snapshot diff windows where current data is being used
|
||||||
|
for (auto& snapshotCurrentDiff : this->snapshotCurrentDiffsBySnapshotAId) {
|
||||||
|
snapshotCurrentDiff->refreshB(
|
||||||
|
*(this->data),
|
||||||
|
this->focusedMemoryRegions,
|
||||||
|
this->excludedMemoryRegions,
|
||||||
|
this->stackPointer.value_or(0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SnapshotManager::resizeEvent(QResizeEvent* event) {
|
void SnapshotManager::resizeEvent(QResizeEvent* event) {
|
||||||
const auto size = this->size();
|
const auto size = this->size();
|
||||||
this->container->setFixedSize(size.width(), size.height());
|
this->container->setFixedSize(size.width(), size.height());
|
||||||
@@ -360,18 +378,17 @@ namespace Bloom::Widgets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto diffKey = snapshotIdA;
|
auto snapshotDiffIt = this->snapshotCurrentDiffsBySnapshotAId.find(snapshotIdA);
|
||||||
auto snapshotDiffIt = this->snapshotDiffs.find(diffKey);
|
|
||||||
|
|
||||||
if (snapshotDiffIt == this->snapshotDiffs.end()) {
|
if (snapshotDiffIt == this->snapshotCurrentDiffsBySnapshotAId.end()) {
|
||||||
const auto& snapshotItA = this->snapshotsById.find(snapshotIdA);
|
const auto& snapshotItA = this->snapshotsById.find(snapshotIdA);
|
||||||
|
|
||||||
if (snapshotItA == this->snapshotsById.end()) {
|
if (snapshotItA == this->snapshotsById.end()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
snapshotDiffIt = this->snapshotDiffs.insert(
|
snapshotDiffIt = this->snapshotCurrentDiffsBySnapshotAId.insert(
|
||||||
diffKey,
|
snapshotIdA,
|
||||||
new SnapshotDiff(
|
new SnapshotDiff(
|
||||||
snapshotItA.value(),
|
snapshotItA.value(),
|
||||||
*(this->data),
|
*(this->data),
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ namespace Bloom::Widgets
|
|||||||
PanelWidget* parent = nullptr
|
PanelWidget* parent = nullptr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void onCurrentDataChanged();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void insightWorkerTaskCreated(const QSharedPointer<InsightWorkerTask>& task);
|
void insightWorkerTaskCreated(const QSharedPointer<InsightWorkerTask>& task);
|
||||||
void snapshotRestored(const QString& snapshotId);
|
void snapshotRestored(const QString& snapshotId);
|
||||||
@@ -69,6 +71,7 @@ namespace Bloom::Widgets
|
|||||||
QMap<QString, MemorySnapshotItem*> snapshotItemsById;
|
QMap<QString, MemorySnapshotItem*> snapshotItemsById;
|
||||||
QMap<QString, SnapshotViewer*> snapshotViewersById;
|
QMap<QString, SnapshotViewer*> snapshotViewersById;
|
||||||
QMap<QString, SnapshotDiff*> snapshotDiffs;
|
QMap<QString, SnapshotDiff*> snapshotDiffs;
|
||||||
|
QMap<QString, SnapshotDiff*> snapshotCurrentDiffsBySnapshotAId;
|
||||||
|
|
||||||
QWidget* container = nullptr;
|
QWidget* container = nullptr;
|
||||||
QWidget* toolBar = nullptr;
|
QWidget* toolBar = nullptr;
|
||||||
|
|||||||
@@ -361,6 +361,8 @@ namespace Bloom::Widgets
|
|||||||
&InsightWorkerTask::finished,
|
&InsightWorkerTask::finished,
|
||||||
this,
|
this,
|
||||||
[this] {
|
[this] {
|
||||||
|
this->snapshotManager->onCurrentDataChanged();
|
||||||
|
|
||||||
this->refreshButton->stopSpin();
|
this->refreshButton->stopSpin();
|
||||||
|
|
||||||
if (this->targetState == Targets::TargetState::STOPPED) {
|
if (this->targetState == Targets::TargetState::STOPPED) {
|
||||||
@@ -380,6 +382,9 @@ namespace Bloom::Widgets
|
|||||||
|
|
||||||
this->taskProgressIndicator->addTask(readStackPointerTask);
|
this->taskProgressIndicator->addTask(readStackPointerTask);
|
||||||
InsightWorker::queueTask(readStackPointerTask);
|
InsightWorker::queueTask(readStackPointerTask);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this->snapshotManager->onCurrentDataChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -580,8 +585,6 @@ namespace Bloom::Widgets
|
|||||||
this->data = data;
|
this->data = data;
|
||||||
this->hexViewerWidget->updateValues();
|
this->hexViewerWidget->updateValues();
|
||||||
this->setStaleData(false);
|
this->setStaleData(false);
|
||||||
|
|
||||||
this->snapshotManager->createSnapshotWindow->refreshForm();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetMemoryInspectionPane::openMemoryRegionManagerWindow() {
|
void TargetMemoryInspectionPane::openMemoryRegionManagerWindow() {
|
||||||
|
|||||||
Reference in New Issue
Block a user