Added TargetMemoryAddress, TargetMemorySize, TargetProgramCounter and TargetStackPointer aliases
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
#include "src/Logger/Logger.hpp"
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
#include "src/Helpers/Paths.hpp"
|
||||
#include "src/Targets/TargetDescriptor.hpp"
|
||||
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp"
|
||||
|
||||
@@ -896,7 +897,7 @@ namespace Bloom
|
||||
readProgramCounterTask,
|
||||
&ReadProgramCounter::programCounterRead,
|
||||
this,
|
||||
[this] (std::uint32_t programCounter) {
|
||||
[this] (Targets::TargetProgramCounter programCounter) {
|
||||
this->programCounterValueLabel->setText(
|
||||
"0x" + QString::number(programCounter, 16).toUpper() + " (" + QString::number(programCounter) + ")"
|
||||
);
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
namespace Bloom::Widgets
|
||||
{
|
||||
AnnotationItem::AnnotationItem(
|
||||
std::uint32_t startAddress,
|
||||
std::size_t size,
|
||||
Targets::TargetMemoryAddress startAddress,
|
||||
Targets::TargetMemorySize size,
|
||||
QString labelText,
|
||||
AnnotationItemPosition position
|
||||
):
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <QGraphicsItem>
|
||||
#include <cstdint>
|
||||
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/FocusedMemoryRegion.hpp"
|
||||
|
||||
namespace Bloom::Widgets
|
||||
@@ -22,14 +24,14 @@ namespace Bloom::Widgets
|
||||
|
||||
const int width;
|
||||
const int height;
|
||||
const std::uint32_t startAddress;
|
||||
const std::uint32_t endAddress;
|
||||
const std::size_t size;
|
||||
const Targets::TargetMemoryAddress startAddress;
|
||||
const Targets::TargetMemoryAddress endAddress;
|
||||
const Targets::TargetMemorySize size;
|
||||
AnnotationItemPosition position = AnnotationItemPosition::TOP;
|
||||
|
||||
AnnotationItem(
|
||||
std::uint32_t startAddress,
|
||||
std::size_t size,
|
||||
Targets::TargetMemoryAddress startAddress,
|
||||
Targets::TargetMemorySize size,
|
||||
QString labelText,
|
||||
AnnotationItemPosition position
|
||||
);
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace Bloom::Widgets
|
||||
{
|
||||
ByteItem::ByteItem(
|
||||
std::size_t byteIndex,
|
||||
std::uint32_t address,
|
||||
std::optional<std::uint32_t>& currentStackPointer,
|
||||
Targets::TargetMemoryAddress address,
|
||||
std::optional<Targets::TargetStackPointer>& currentStackPointer,
|
||||
ByteItem** hoveredByteItem,
|
||||
AnnotationItem** hoveredAnnotationItem,
|
||||
std::set<ByteItem*>& highlightedByteItems,
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <optional>
|
||||
#include <set>
|
||||
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
#include "HexViewerWidgetSettings.hpp"
|
||||
#include "AnnotationItem.hpp"
|
||||
|
||||
@@ -25,7 +27,7 @@ namespace Bloom::Widgets
|
||||
static constexpr int BOTTOM_MARGIN = 5;
|
||||
|
||||
std::size_t byteIndex;
|
||||
std::uint32_t address = 0x00;
|
||||
Targets::TargetMemoryAddress address = 0x00;
|
||||
|
||||
QString addressHex;
|
||||
QString relativeAddressHex;
|
||||
@@ -40,8 +42,8 @@ namespace Bloom::Widgets
|
||||
|
||||
ByteItem(
|
||||
std::size_t byteIndex,
|
||||
std::uint32_t address,
|
||||
std::optional<std::uint32_t>& currentStackPointer,
|
||||
Targets::TargetMemoryAddress address,
|
||||
std::optional<Targets::TargetStackPointer>& currentStackPointer,
|
||||
ByteItem** hoveredByteItem,
|
||||
AnnotationItem** hoveredAnnotationItem,
|
||||
std::set<ByteItem*>& highlightedByteItems,
|
||||
@@ -71,7 +73,7 @@ namespace Bloom::Widgets
|
||||
|
||||
ByteItem** hoveredByteItem;
|
||||
AnnotationItem** hoveredAnnotationItem;
|
||||
std::optional<std::uint32_t>& currentStackPointer;
|
||||
std::optional<Targets::TargetStackPointer>& currentStackPointer;
|
||||
std::set<ByteItem*>& highlightedByteItems;
|
||||
|
||||
const QColor* getBackgroundColor();
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Bloom::Widgets
|
||||
|
||||
}
|
||||
|
||||
void ByteItemContainerGraphicsView::scrollToByteItemAtAddress(std::uint32_t address) {
|
||||
void ByteItemContainerGraphicsView::scrollToByteItemAtAddress(Targets::TargetMemoryAddress address) {
|
||||
this->centerOn(this->scene->getByteItemPositionByAddress(address));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Bloom::Widgets
|
||||
return this->scene;
|
||||
}
|
||||
|
||||
void scrollToByteItemAtAddress(std::uint32_t address);
|
||||
void scrollToByteItemAtAddress(Targets::TargetMemoryAddress address);
|
||||
|
||||
protected:
|
||||
bool event(QEvent* event) override;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Bloom::Widgets
|
||||
// Construct ByteWidget objects
|
||||
const auto memorySize = this->targetMemoryDescriptor.size();
|
||||
const auto startAddress = this->targetMemoryDescriptor.addressRange.startAddress;
|
||||
for (std::uint32_t i = 0; i < memorySize; i++) {
|
||||
for (Targets::TargetMemorySize i = 0; i < memorySize; i++) {
|
||||
const auto address = startAddress + i;
|
||||
|
||||
auto* byteWidget = new ByteItem(
|
||||
|
||||
@@ -53,13 +53,13 @@ namespace Bloom::Widgets
|
||||
);
|
||||
|
||||
void updateValues(const Targets::TargetMemoryBuffer& buffer);
|
||||
void updateStackPointer(std::uint32_t stackPointer);
|
||||
void setHighlightedAddresses(const std::set<std::uint32_t>& highlightedAddresses);
|
||||
void updateStackPointer(Targets::TargetStackPointer stackPointer);
|
||||
void setHighlightedAddresses(const std::set<Targets::TargetMemoryAddress>& highlightedAddresses);
|
||||
void refreshRegions();
|
||||
void adjustSize(bool forced = false);
|
||||
void setEnabled(bool enabled);
|
||||
void invalidateChildItemCaches();
|
||||
QPointF getByteItemPositionByAddress(std::uint32_t address);
|
||||
QPointF getByteItemPositionByAddress(Targets::TargetMemoryAddress address);
|
||||
|
||||
signals:
|
||||
void byteWidgetsAdjusted();
|
||||
@@ -81,11 +81,11 @@ namespace Bloom::Widgets
|
||||
ByteItem* hoveredByteWidget = nullptr;
|
||||
AnnotationItem* hoveredAnnotationItem = nullptr;
|
||||
|
||||
std::optional<std::uint32_t> currentStackPointer;
|
||||
std::optional<Targets::TargetStackPointer> currentStackPointer;
|
||||
|
||||
Targets::TargetMemoryBuffer lastValueBuffer;
|
||||
|
||||
std::map<std::uint32_t, ByteItem*> byteItemsByAddress;
|
||||
std::map<Targets::TargetMemoryAddress, ByteItem*> byteItemsByAddress;
|
||||
std::vector<AnnotationItem*> annotationItems;
|
||||
std::vector<ValueAnnotationItem*> valueAnnotationItems;
|
||||
std::map<std::size_t, std::vector<ByteItem*>> byteItemsByRowIndex;
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace Bloom::Widgets
|
||||
this->byteItemGraphicsScene->refreshRegions();
|
||||
}
|
||||
|
||||
void HexViewerWidget::setStackPointer(std::uint32_t stackPointer) {
|
||||
void HexViewerWidget::setStackPointer(Targets::TargetStackPointer stackPointer) {
|
||||
this->byteItemGraphicsScene->updateStackPointer(stackPointer);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Bloom::Widgets
|
||||
|
||||
void updateValues(const Targets::TargetMemoryBuffer& buffer);
|
||||
void refreshRegions();
|
||||
void setStackPointer(std::uint32_t stackPointer);
|
||||
void setStackPointer(Targets::TargetStackPointer stackPointer);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace Bloom::Widgets
|
||||
readStackPointerTask,
|
||||
&ReadStackPointer::stackPointerRead,
|
||||
this,
|
||||
[this] (std::uint32_t stackPointer) {
|
||||
[this] (Targets::TargetStackPointer stackPointer) {
|
||||
this->hexViewerWidget->setStackPointer(stackPointer);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user