diff options
author | Lioncash <mathew1800@gmail.com> | 2019-11-26 16:29:34 -0500 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-11-26 21:55:39 -0500 |
commit | b05bfc603689419dc515a656b9fc711d79994f13 (patch) | |
tree | bc0937d11bbe31458785a69478edbf11a720b0ae /src/core/gdbstub/gdbstub.cpp | |
parent | 89ef3ef5752e42d0eb0bdfa23cc72d391db74216 (diff) |
core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory class
With all of the trivial parts of the memory interface moved over, we can
get right into moving over the bits that are used.
Note that this does require the use of GetInstance from the global
system instance to be used within hle_ipc.cpp and the gdbstub. This is
fine for the time being, as they both already rely on the global system
instance in other functions. These will be removed in a change directed
at both of these respectively.
For now, it's sufficient, as it still accomplishes the goal of
de-globalizing the memory code.
Diffstat (limited to 'src/core/gdbstub/gdbstub.cpp')
-rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 78e44f3bdb..1c74a44d82 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -969,13 +969,13 @@ static void ReadMemory() { SendReply("E01"); } - const auto& memory = Core::System::GetInstance().Memory(); + auto& memory = Core::System::GetInstance().Memory(); if (!memory.IsValidVirtualAddress(addr)) { return SendReply("E00"); } std::vector<u8> data(len); - Memory::ReadBlock(addr, data.data(), len); + memory.ReadBlock(addr, data.data(), len); MemToGdbHex(reply, data.data(), len); reply[len * 2] = '\0'; @@ -1057,7 +1057,9 @@ static bool CommitBreakpoint(BreakpointType type, VAddr addr, u64 len) { breakpoint.active = true; breakpoint.addr = addr; breakpoint.len = len; - Memory::ReadBlock(addr, breakpoint.inst.data(), breakpoint.inst.size()); + + auto& memory = Core::System::GetInstance().Memory(); + memory.ReadBlock(addr, breakpoint.inst.data(), breakpoint.inst.size()); static constexpr std::array<u8, 4> btrap{0x00, 0x7d, 0x20, 0xd4}; if (type == BreakpointType::Execute) { |