summaryrefslogtreecommitdiff
path: root/Source/Core/Common/BreakPoints.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/BreakPoints.cpp')
-rw-r--r--Source/Core/Common/BreakPoints.cpp97
1 files changed, 97 insertions, 0 deletions
diff --git a/Source/Core/Common/BreakPoints.cpp b/Source/Core/Common/BreakPoints.cpp
index db0cedf0bb..8772a2287f 100644
--- a/Source/Core/Common/BreakPoints.cpp
+++ b/Source/Core/Common/BreakPoints.cpp
@@ -113,6 +113,19 @@ void BreakPoints::Clear()
m_BreakPoints.clear();
}
+void BreakPoints::ClearAllTemporary()
+{
+ for (const TBreakPoint& bp : m_BreakPoints)
+ {
+ if (bp.bTemporary)
+ {
+ if (jit)
+ jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4, true);
+ Remove(bp.iAddress);
+ }
+ }
+}
+
MemChecks::TMemChecksStr MemChecks::GetStrings() const
{
TMemChecksStr mcs;
@@ -204,3 +217,87 @@ void TMemCheck::Action(DebugInterface *debug_interface, u32 iValue, u32 addr, bo
debug_interface->BreakNow();
}
}
+
+
+const bool Watches::IsAddressWatch(u32 _iAddress)
+{
+ for (const TWatch& bp : m_Watches)
+ if (bp.iAddress == _iAddress)
+ return true;
+
+ return false;
+}
+
+Watches::TWatchesStr Watches::GetStrings() const
+{
+ TWatchesStr bps;
+ for (const TWatch& bp : m_Watches)
+ {
+ std::stringstream ss;
+ ss << std::hex << bp.iAddress << " " << bp.name;
+ bps.push_back(ss.str());
+ }
+
+ return bps;
+}
+
+void Watches::AddFromStrings(const TWatchesStr& bpstrs)
+{
+ for (const std::string& bpstr : bpstrs)
+ {
+ TWatch bp;
+ std::stringstream ss;
+ ss << std::hex << bpstr;
+ ss >> bp.iAddress;
+ ss >> std::ws;
+ getline(ss, bp.name);
+ Add(bp);
+ }
+}
+
+void Watches::Add(const TWatch& bp)
+{
+ if (!IsAddressWatch(bp.iAddress))
+ {
+ m_Watches.push_back(bp);
+ }
+}
+
+void Watches::Add(u32 em_address)
+{
+ if (!IsAddressWatch(em_address)) // only add new addresses
+ {
+ TWatch pt; // breakpoint settings
+ pt.bOn = true;
+ pt.iAddress = em_address;
+
+ m_Watches.push_back(pt);
+ }
+}
+
+void Watches::Update(int count, u32 em_address)
+{
+ m_Watches.at(count).iAddress = em_address;
+}
+
+void Watches::UpdateName(int count, const std::string name)
+{
+ m_Watches.at(count).name = name;
+}
+
+void Watches::Remove(u32 em_address)
+{
+ for (auto i = m_Watches.begin(); i != m_Watches.end(); ++i)
+ {
+ if (i->iAddress == em_address)
+ {
+ m_Watches.erase(i);
+ return;
+ }
+ }
+}
+
+void Watches::Clear()
+{
+ m_Watches.clear();
+}