summaryrefslogtreecommitdiff
path: root/Source/Core/Common/BreakPoints.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2015-04-27 19:42:13 +1000
committerskidau <skidau@gmail.com>2015-04-27 19:42:13 +1000
commit472e28144561cd2a48bf9ec6b6ac8fdbfbc37501 (patch)
tree06f5cbeb7eb235cab2a0e2964ee9c28c141667a6 /Source/Core/Common/BreakPoints.cpp
parentb457c61b3e5709c8ee85ac4606c6e6fed2821f93 (diff)
parent132e1068ce7b2cc39d52facff9a33d0f3a582ae8 (diff)
Merge pull request #2316 from comex/fix-watch
Fix watchpoints ("memory breakpoints") with JIT
Diffstat (limited to 'Source/Core/Common/BreakPoints.cpp')
-rw-r--r--Source/Core/Common/BreakPoints.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/Core/Common/BreakPoints.cpp b/Source/Core/Common/BreakPoints.cpp
index 74dcb45030..277b956e61 100644
--- a/Source/Core/Common/BreakPoints.cpp
+++ b/Source/Core/Common/BreakPoints.cpp
@@ -165,8 +165,13 @@ void MemChecks::AddFromStrings(const TMemChecksStr& mcstrs)
void MemChecks::Add(const TMemCheck& _rMemoryCheck)
{
+ bool had_any = HasAny();
if (GetMemCheck(_rMemoryCheck.StartAddress) == nullptr)
m_MemChecks.push_back(_rMemoryCheck);
+ // If this is the first one, clear the JIT cache so it can switch to
+ // watchpoint-compatible code.
+ if (!had_any)
+ jit->ClearCache();
}
void MemChecks::Remove(u32 _Address)
@@ -179,6 +184,8 @@ void MemChecks::Remove(u32 _Address)
return;
}
}
+ if (!HasAny())
+ jit->ClearCache();
}
TMemCheck *MemChecks::GetMemCheck(u32 address)
@@ -200,7 +207,7 @@ TMemCheck *MemChecks::GetMemCheck(u32 address)
return nullptr;
}
-void TMemCheck::Action(DebugInterface *debug_interface, u32 iValue, u32 addr, bool write, int size, u32 pc)
+bool TMemCheck::Action(DebugInterface *debug_interface, u32 iValue, u32 addr, bool write, int size, u32 pc)
{
if ((write && OnWrite) || (!write && OnRead))
{
@@ -213,9 +220,9 @@ void TMemCheck::Action(DebugInterface *debug_interface, u32 iValue, u32 addr, bo
);
}
- if (Break)
- debug_interface->BreakNow();
+ return true;
}
+ return false;
}