From 39edc1d91e923c10ae7c8e8c9fdb2751f2ff2e37 Mon Sep 17 00:00:00 2001 From: EmptyChaos Date: Thu, 15 Sep 2016 03:08:48 +0000 Subject: [PATCH] PPCDebugInterface: Fix ToggleMemcheck ToggleMemCheck fails to create a memcheck if one doesn't already exist. --- Source/Core/Core/Debugger/PPCDebugInterface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.cpp b/Source/Core/Core/Debugger/PPCDebugInterface.cpp index b07b3737c8..3073178d23 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.cpp +++ b/Source/Core/Core/Debugger/PPCDebugInterface.cpp @@ -137,12 +137,12 @@ void PPCDebugInterface::ClearAllMemChecks() bool PPCDebugInterface::IsMemCheck(unsigned int address) { - return (PowerPC::memchecks.HasAny() && PowerPC::memchecks.GetMemCheck(address)); + return PowerPC::memchecks.GetMemCheck(address) != nullptr; } void PPCDebugInterface::ToggleMemCheck(unsigned int address, bool read, bool write, bool log) { - if (PowerPC::memchecks.HasAny() && !PowerPC::memchecks.GetMemCheck(address)) + if (!IsMemCheck(address)) { // Add Memory Check TMemCheck MemCheck; @@ -157,7 +157,9 @@ void PPCDebugInterface::ToggleMemCheck(unsigned int address, bool read, bool wri PowerPC::memchecks.Add(MemCheck); } else + { PowerPC::memchecks.Remove(address); + } } void PPCDebugInterface::InsertBLR(unsigned int address, unsigned int value)