diff options
author | Hedges <hedges@resync.pl> | 2018-08-07 04:01:24 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-08-07 04:01:24 +0200 |
commit | e2b74f635410891b4ab9c202ecdd83dfe05df239 (patch) | |
tree | 90cf31b4b0f60d86709bfec1a3c021056bd0a269 /src/core/gdbstub | |
parent | Merge pull request #943 from lioncash/decl (diff) | |
download | yuzu-e2b74f635410891b4ab9c202ecdd83dfe05df239.tar yuzu-e2b74f635410891b4ab9c202ecdd83dfe05df239.tar.gz yuzu-e2b74f635410891b4ab9c202ecdd83dfe05df239.tar.bz2 yuzu-e2b74f635410891b4ab9c202ecdd83dfe05df239.tar.lz yuzu-e2b74f635410891b4ab9c202ecdd83dfe05df239.tar.xz yuzu-e2b74f635410891b4ab9c202ecdd83dfe05df239.tar.zst yuzu-e2b74f635410891b4ab9c202ecdd83dfe05df239.zip |
Diffstat (limited to 'src/core/gdbstub')
-rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 884e64e99..332e5c3d0 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -173,6 +173,7 @@ struct Breakpoint { bool active; VAddr addr; u64 len; + std::array<u8, 4> inst; }; using BreakpointMap = std::map<VAddr, Breakpoint>; @@ -453,6 +454,8 @@ static void RemoveBreakpoint(BreakpointType type, VAddr addr) { LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:016X} bytes at {:016X} of type {}", bp->second.len, bp->second.addr, static_cast<int>(type)); + Memory::WriteBlock(bp->second.addr, bp->second.inst.data(), bp->second.inst.size()); + Core::System::GetInstance().InvalidateCpuInstructionCaches(); p.erase(addr); } @@ -937,6 +940,7 @@ static void WriteMemory() { GdbHexToMem(data.data(), len_pos + 1, len); Memory::WriteBlock(addr, data.data(), len); + Core::System::GetInstance().InvalidateCpuInstructionCaches(); SendReply("OK"); } @@ -956,6 +960,7 @@ static void Step() { step_loop = true; halt_loop = true; send_trap = true; + Core::System::GetInstance().InvalidateCpuInstructionCaches(); } /// Tell the CPU if we hit a memory breakpoint. @@ -972,6 +977,7 @@ static void Continue() { memory_break = false; step_loop = false; halt_loop = false; + Core::System::GetInstance().InvalidateCpuInstructionCaches(); } /** @@ -988,6 +994,10 @@ 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()); + static constexpr std::array<u8, 4> btrap{{0xd4, 0x20, 0x7d, 0x0}}; + Memory::WriteBlock(addr, btrap.data(), btrap.size()); + Core::System::GetInstance().InvalidateCpuInstructionCaches(); p.insert({addr, breakpoint}); LOG_DEBUG(Debug_GDBStub, "gdb: added {} breakpoint: {:016X} bytes at {:016X}", |