diff --git a/Source/Core/Common/Debug/MemoryPatches.cpp b/Source/Core/Common/Debug/MemoryPatches.cpp index 9b49929d4ec8..9e054029ad43 100644 --- a/Source/Core/Common/Debug/MemoryPatches.cpp +++ b/Source/Core/Common/Debug/MemoryPatches.cpp @@ -38,6 +38,11 @@ void MemoryPatches::SetPatch(u32 address, std::vector value) Patch(index); } +const MemoryPatch& MemoryPatches::GetPatch(std::size_t index) const +{ + return m_patches.at(index); +} + const std::vector& MemoryPatches::GetPatches() const { return m_patches; diff --git a/Source/Core/Common/Debug/MemoryPatches.h b/Source/Core/Common/Debug/MemoryPatches.h index 2f76443747cc..0456f17f541e 100644 --- a/Source/Core/Common/Debug/MemoryPatches.h +++ b/Source/Core/Common/Debug/MemoryPatches.h @@ -36,6 +36,7 @@ class MemoryPatches void SetPatch(u32 address, u32 value); void SetPatch(u32 address, std::vector value); + const MemoryPatch& GetPatch(std::size_t index) const; const std::vector& GetPatches() const; void UnsetPatch(u32 address); void EnablePatch(std::size_t index); diff --git a/Source/Core/Common/DebugInterface.h b/Source/Core/Common/DebugInterface.h index bdbe927e393a..7b377ca53060 100644 --- a/Source/Core/Common/DebugInterface.h +++ b/Source/Core/Common/DebugInterface.h @@ -44,6 +44,7 @@ class DebugInterface // Memory Patches virtual void SetPatch(u32 address, u32 value) = 0; virtual void SetPatch(u32 address, std::vector value) = 0; + virtual const Debug::MemoryPatch& GetPatch(std::size_t index) const = 0; virtual const std::vector& GetPatches() const = 0; virtual void UnsetPatch(u32 address) = 0; virtual void EnablePatch(std::size_t index) = 0; diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.cpp b/Source/Core/Core/Debugger/PPCDebugInterface.cpp index fb6840a32763..b9cac6b30d94 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.cpp +++ b/Source/Core/Core/Debugger/PPCDebugInterface.cpp @@ -131,6 +131,11 @@ void PPCDebugInterface::SetPatch(u32 address, std::vector value) m_patches.SetPatch(address, std::move(value)); } +const Common::Debug::MemoryPatch& PPCDebugInterface::GetPatch(std::size_t index) const +{ + return m_patches.GetPatch(index); +} + const std::vector& PPCDebugInterface::GetPatches() const { return m_patches.GetPatches(); diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.h b/Source/Core/Core/Debugger/PPCDebugInterface.h index 8b9c265e8418..12b498274ef0 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.h +++ b/Source/Core/Core/Debugger/PPCDebugInterface.h @@ -46,6 +46,7 @@ class PPCDebugInterface final : public Common::DebugInterface // Memory Patches void SetPatch(u32 address, u32 value) override; void SetPatch(u32 address, std::vector value) override; + const Common::Debug::MemoryPatch& GetPatch(std::size_t index) const override; const std::vector& GetPatches() const override; void UnsetPatch(u32 address) override; void EnablePatch(std::size_t index) override;