From 3f6b114c2f16e0c882bd3f7c03799937a4f4ba33 Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 11 Nov 2021 19:10:31 +0000 Subject: [PATCH] Updated memory inspection refresh routine to include the refreshing of the stack pointer value. --- .../HexViewerWidget/HexViewerWidget.cpp | 5 +++++ .../HexViewerWidget/HexViewerWidget.hpp | 2 ++ .../TargetMemoryInspectionPane.cpp | 17 ++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp index f687aedf..a03b04d0 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp @@ -98,6 +98,11 @@ void HexViewerWidget::updateValues(const Targets::TargetMemoryBuffer& buffer) { this->byteItemGraphicsScene->updateValues(buffer); } +void HexViewerWidget::setStackPointer(std::uint32_t stackPointer) { + this->settings.stackPointerAddress = stackPointer; + this->byteItemGraphicsScene->update(); +} + void HexViewerWidget::resizeEvent(QResizeEvent* event) { this->container->setFixedSize( this->width(), diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp index 849a18d2..92a5d9c1 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp @@ -38,6 +38,8 @@ namespace Bloom::Widgets void updateValues(const Targets::TargetMemoryBuffer& buffer); + void setStackPointer(std::uint32_t stackPointer); + protected: void resizeEvent(QResizeEvent* event) override; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 9f5d931a..f14eee11 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -8,6 +8,7 @@ #include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp" #include "src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp" +#include "src/Insight/InsightWorker/Tasks/ReadStackPointer.hpp" #include "src/Helpers/Paths.hpp" #include "src/Exceptions/Exception.hpp" @@ -84,7 +85,21 @@ void TargetMemoryInspectionPane::refreshMemoryValues(std::optionalonMemoryRead(buffer); + + auto* readStackPointerTask = new ReadStackPointer(); + QObject::connect( + readStackPointerTask, + &ReadStackPointer::stackPointerRead, + this, + [this] (std::uint32_t stackPointer) { + this->hexViewerWidget->setStackPointer(stackPointer); + } + ); + + this->insightWorker.queueTask(readStackPointerTask); + } ); QObject::connect(