Skip to content

Commit

Permalink
DebugInterface: GetPatch method added
Browse files Browse the repository at this point in the history
  • Loading branch information
sepalani committed Feb 28, 2021
1 parent 6982832 commit 776c48d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Core/Common/Debug/MemoryPatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ void MemoryPatches::SetPatch(u32 address, std::vector<u8> value)
Patch(index);
}

const MemoryPatch& MemoryPatches::GetPatch(std::size_t index) const
{
return m_patches.at(index);
}

const std::vector<MemoryPatch>& MemoryPatches::GetPatches() const
{
return m_patches;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/Debug/MemoryPatches.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class MemoryPatches

void SetPatch(u32 address, u32 value);
void SetPatch(u32 address, std::vector<u8> value);
const MemoryPatch& GetPatch(std::size_t index) const;
const std::vector<MemoryPatch>& GetPatches() const;
void UnsetPatch(u32 address);
void EnablePatch(std::size_t index);
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/DebugInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class DebugInterface
// Memory Patches
virtual void SetPatch(u32 address, u32 value) = 0;
virtual void SetPatch(u32 address, std::vector<u8> value) = 0;
virtual const Debug::MemoryPatch& GetPatch(std::size_t index) const = 0;
virtual const std::vector<Debug::MemoryPatch>& GetPatches() const = 0;
virtual void UnsetPatch(u32 address) = 0;
virtual void EnablePatch(std::size_t index) = 0;
Expand Down
5 changes: 5 additions & 0 deletions Source/Core/Core/Debugger/PPCDebugInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ void PPCDebugInterface::SetPatch(u32 address, std::vector<u8> 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<Common::Debug::MemoryPatch>& PPCDebugInterface::GetPatches() const
{
return m_patches.GetPatches();
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Debugger/PPCDebugInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> value) override;
const Common::Debug::MemoryPatch& GetPatch(std::size_t index) const override;
const std::vector<Common::Debug::MemoryPatch>& GetPatches() const override;
void UnsetPatch(u32 address) override;
void EnablePatch(std::size_t index) override;
Expand Down

0 comments on commit 776c48d

Please sign in to comment.