summaryrefslogtreecommitdiffstats
path: root/src/core/gdbstub
diff options
context:
space:
mode:
authorDimitri ALBORA <dimitripilot3@gmail.com>2019-01-26 22:08:39 +0100
committerfearlessTobi <thm.frey@gmail.com>2019-02-06 19:07:35 +0100
commit8b800369ea31a96fd83bb94cfc1825978b3f7fdd (patch)
treef291e6ec5ee7a34c813b92828da7ab94d7521162 /src/core/gdbstub
parentMerge pull request #2057 from FearlessTobi/port-4586 (diff)
downloadyuzu-8b800369ea31a96fd83bb94cfc1825978b3f7fdd.tar
yuzu-8b800369ea31a96fd83bb94cfc1825978b3f7fdd.tar.gz
yuzu-8b800369ea31a96fd83bb94cfc1825978b3f7fdd.tar.bz2
yuzu-8b800369ea31a96fd83bb94cfc1825978b3f7fdd.tar.lz
yuzu-8b800369ea31a96fd83bb94cfc1825978b3f7fdd.tar.xz
yuzu-8b800369ea31a96fd83bb94cfc1825978b3f7fdd.tar.zst
yuzu-8b800369ea31a96fd83bb94cfc1825978b3f7fdd.zip
Diffstat (limited to 'src/core/gdbstub')
-rw-r--r--src/core/gdbstub/gdbstub.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp
index a1cad4fcb..dafb32aae 100644
--- a/src/core/gdbstub/gdbstub.cpp
+++ b/src/core/gdbstub/gdbstub.cpp
@@ -507,8 +507,11 @@ 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();
+
+ if (type == BreakpointType::Execute) {
+ Memory::WriteBlock(bp->second.addr, bp->second.inst.data(), bp->second.inst.size());
+ Core::System::GetInstance().InvalidateCpuInstructionCaches();
+ }
p.erase(addr);
}
@@ -1057,9 +1060,12 @@ static bool CommitBreakpoint(BreakpointType type, VAddr addr, u64 len) {
breakpoint.addr = addr;
breakpoint.len = len;
Memory::ReadBlock(addr, breakpoint.inst.data(), breakpoint.inst.size());
+
static constexpr std::array<u8, 4> btrap{0x00, 0x7d, 0x20, 0xd4};
- Memory::WriteBlock(addr, btrap.data(), btrap.size());
- Core::System::GetInstance().InvalidateCpuInstructionCaches();
+ if (type == BreakpointType::Execute) {
+ 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}",