diff options
Diffstat (limited to 'src/common/break_points.cpp')
| -rw-r--r-- | src/common/break_points.cpp | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/src/common/break_points.cpp b/src/common/break_points.cpp deleted file mode 100644 index fa367a4ca..000000000 --- a/src/common/break_points.cpp +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <algorithm> | ||
| 6 | #include <sstream> | ||
| 7 | #include "common/break_points.h" | ||
| 8 | |||
| 9 | bool BreakPoints::IsAddressBreakPoint(u32 iAddress) const { | ||
| 10 | auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress; }; | ||
| 11 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); | ||
| 12 | return it != m_BreakPoints.end(); | ||
| 13 | } | ||
| 14 | |||
| 15 | bool BreakPoints::IsTempBreakPoint(u32 iAddress) const { | ||
| 16 | auto cond = [&iAddress](const TBreakPoint& bp) { | ||
| 17 | return bp.iAddress == iAddress && bp.bTemporary; | ||
| 18 | }; | ||
| 19 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); | ||
| 20 | return it != m_BreakPoints.end(); | ||
| 21 | } | ||
| 22 | |||
| 23 | BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const { | ||
| 24 | TBreakPointsStr bps; | ||
| 25 | for (auto breakpoint : m_BreakPoints) { | ||
| 26 | if (!breakpoint.bTemporary) { | ||
| 27 | std::stringstream bp; | ||
| 28 | bp << std::hex << breakpoint.iAddress << " " << (breakpoint.bOn ? "n" : ""); | ||
| 29 | bps.push_back(bp.str()); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | return bps; | ||
| 34 | } | ||
| 35 | |||
| 36 | void BreakPoints::AddFromStrings(const TBreakPointsStr& bps) { | ||
| 37 | for (auto bps_item : bps) { | ||
| 38 | TBreakPoint bp; | ||
| 39 | std::stringstream bpstr; | ||
| 40 | bpstr << std::hex << bps_item; | ||
| 41 | bpstr >> bp.iAddress; | ||
| 42 | bp.bOn = bps_item.find("n") != bps_item.npos; | ||
| 43 | bp.bTemporary = false; | ||
| 44 | Add(bp); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | void BreakPoints::Add(const TBreakPoint& bp) { | ||
| 49 | if (!IsAddressBreakPoint(bp.iAddress)) { | ||
| 50 | m_BreakPoints.push_back(bp); | ||
| 51 | // if (jit) | ||
| 52 | // jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4); | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | void BreakPoints::Add(u32 em_address, bool temp) { | ||
| 57 | if (!IsAddressBreakPoint(em_address)) // only add new addresses | ||
| 58 | { | ||
| 59 | TBreakPoint pt; // breakpoint settings | ||
| 60 | pt.bOn = true; | ||
| 61 | pt.bTemporary = temp; | ||
| 62 | pt.iAddress = em_address; | ||
| 63 | |||
| 64 | m_BreakPoints.push_back(pt); | ||
| 65 | |||
| 66 | // if (jit) | ||
| 67 | // jit->GetBlockCache()->InvalidateICache(em_address, 4); | ||
| 68 | } | ||
| 69 | } | ||
| 70 | |||
| 71 | void BreakPoints::Remove(u32 em_address) { | ||
| 72 | auto cond = [&em_address](const TBreakPoint& bp) { return bp.iAddress == em_address; }; | ||
| 73 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); | ||
| 74 | if (it != m_BreakPoints.end()) | ||
| 75 | m_BreakPoints.erase(it); | ||
| 76 | } | ||
| 77 | |||
| 78 | void BreakPoints::Clear() { | ||
| 79 | // if (jit) | ||
| 80 | //{ | ||
| 81 | // std::for_each(m_BreakPoints.begin(), m_BreakPoints.end(), | ||
| 82 | // [](const TBreakPoint& bp) | ||
| 83 | // { | ||
| 84 | // jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4); | ||
| 85 | // } | ||
| 86 | // ); | ||
| 87 | //} | ||
| 88 | |||
| 89 | m_BreakPoints.clear(); | ||
| 90 | } | ||