summaryrefslogtreecommitdiffstats
path: root/src/common/break_points.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/common/break_points.cpp
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Diffstat (limited to 'src/common/break_points.cpp')
-rw-r--r--src/common/break_points.cpp54
1 files changed, 22 insertions, 32 deletions
diff --git a/src/common/break_points.cpp b/src/common/break_points.cpp
index e7d0d3e43..3218db314 100644
--- a/src/common/break_points.cpp
+++ b/src/common/break_points.cpp
@@ -5,30 +5,27 @@
#include "common/break_points.h"
#include "common/logging/log.h"
-#include <sstream>
#include <algorithm>
+#include <sstream>
-bool BreakPoints::IsAddressBreakPoint(u32 iAddress) const
-{
+bool BreakPoints::IsAddressBreakPoint(u32 iAddress) const {
auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress; };
- auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond);
+ auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond);
return it != m_BreakPoints.end();
}
-bool BreakPoints::IsTempBreakPoint(u32 iAddress) const
-{
- auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress && bp.bTemporary; };
- auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond);
+bool BreakPoints::IsTempBreakPoint(u32 iAddress) const {
+ auto cond = [&iAddress](const TBreakPoint& bp) {
+ return bp.iAddress == iAddress && bp.bTemporary;
+ };
+ auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond);
return it != m_BreakPoints.end();
}
-BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const
-{
+BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const {
TBreakPointsStr bps;
- for (auto breakpoint : m_BreakPoints)
- {
- if (!breakpoint.bTemporary)
- {
+ for (auto breakpoint : m_BreakPoints) {
+ if (!breakpoint.bTemporary) {
std::stringstream bp;
bp << std::hex << breakpoint.iAddress << " " << (breakpoint.bOn ? "n" : "");
bps.push_back(bp.str());
@@ -38,10 +35,8 @@ BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const
return bps;
}
-void BreakPoints::AddFromStrings(const TBreakPointsStr& bps)
-{
- for (auto bps_item : bps)
- {
+void BreakPoints::AddFromStrings(const TBreakPointsStr& bps) {
+ for (auto bps_item : bps) {
TBreakPoint bp;
std::stringstream bpstr;
bpstr << std::hex << bps_item;
@@ -52,18 +47,15 @@ void BreakPoints::AddFromStrings(const TBreakPointsStr& bps)
}
}
-void BreakPoints::Add(const TBreakPoint& bp)
-{
- if (!IsAddressBreakPoint(bp.iAddress))
- {
+void BreakPoints::Add(const TBreakPoint& bp) {
+ if (!IsAddressBreakPoint(bp.iAddress)) {
m_BreakPoints.push_back(bp);
- //if (jit)
+ // if (jit)
// jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4);
}
}
-void BreakPoints::Add(u32 em_address, bool temp)
-{
+void BreakPoints::Add(u32 em_address, bool temp) {
if (!IsAddressBreakPoint(em_address)) // only add new addresses
{
TBreakPoint pt; // breakpoint settings
@@ -73,22 +65,20 @@ void BreakPoints::Add(u32 em_address, bool temp)
m_BreakPoints.push_back(pt);
- //if (jit)
+ // if (jit)
// jit->GetBlockCache()->InvalidateICache(em_address, 4);
}
}
-void BreakPoints::Remove(u32 em_address)
-{
+void BreakPoints::Remove(u32 em_address) {
auto cond = [&em_address](const TBreakPoint& bp) { return bp.iAddress == em_address; };
- auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond);
+ auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond);
if (it != m_BreakPoints.end())
m_BreakPoints.erase(it);
}
-void BreakPoints::Clear()
-{
- //if (jit)
+void BreakPoints::Clear() {
+ // if (jit)
//{
// std::for_each(m_BreakPoints.begin(), m_BreakPoints.end(),
// [](const TBreakPoint& bp)