diff options
| -rw-r--r-- | src/citra_qt/debugger/disassembler.cpp | 5 | ||||
| -rw-r--r-- | src/common/break_points.cpp | 4 | ||||
| -rw-r--r-- | src/common/break_points.h | 4 |
3 files changed, 5 insertions, 8 deletions
diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 54d21dc90..f620687ae 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp | |||
| @@ -232,11 +232,8 @@ void DisassemblerWidget::OnDebugModeEntered() | |||
| 232 | { | 232 | { |
| 233 | ARMword next_instr = Core::g_app_core->GetPC(); | 233 | ARMword next_instr = Core::g_app_core->GetPC(); |
| 234 | 234 | ||
| 235 | // TODO: Make BreakPoints less crappy (i.e. const-correct) so that this doesn't need a const_cast. | 235 | if (model->GetBreakPoints().IsAddressBreakPoint(next_instr)) |
| 236 | if (const_cast<BreakPoints&>(model->GetBreakPoints()).IsAddressBreakPoint(next_instr)) | ||
| 237 | { | ||
| 238 | emu_thread.SetCpuRunning(false); | 236 | emu_thread.SetCpuRunning(false); |
| 239 | } | ||
| 240 | 237 | ||
| 241 | model->SetNextInstruction(next_instr); | 238 | model->SetNextInstruction(next_instr); |
| 242 | 239 | ||
diff --git a/src/common/break_points.cpp b/src/common/break_points.cpp index 2655d3ce9..15055bd4e 100644 --- a/src/common/break_points.cpp +++ b/src/common/break_points.cpp | |||
| @@ -10,14 +10,14 @@ | |||
| 10 | #include <sstream> | 10 | #include <sstream> |
| 11 | #include <algorithm> | 11 | #include <algorithm> |
| 12 | 12 | ||
| 13 | bool BreakPoints::IsAddressBreakPoint(u32 iAddress) | 13 | bool BreakPoints::IsAddressBreakPoint(u32 iAddress) const |
| 14 | { | 14 | { |
| 15 | auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress; }; | 15 | auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress; }; |
| 16 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); | 16 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); |
| 17 | return it != m_BreakPoints.end(); | 17 | return it != m_BreakPoints.end(); |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | bool BreakPoints::IsTempBreakPoint(u32 iAddress) | 20 | bool BreakPoints::IsTempBreakPoint(u32 iAddress) const |
| 21 | { | 21 | { |
| 22 | auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress && bp.bTemporary; }; | 22 | auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress && bp.bTemporary; }; |
| 23 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); | 23 | auto it = std::find_if(m_BreakPoints.begin(), m_BreakPoints.end(), cond); |
diff --git a/src/common/break_points.h b/src/common/break_points.h index 5557cd50e..4b26cf90d 100644 --- a/src/common/break_points.h +++ b/src/common/break_points.h | |||
| @@ -56,8 +56,8 @@ public: | |||
| 56 | void AddFromStrings(const TBreakPointsStr& bps); | 56 | void AddFromStrings(const TBreakPointsStr& bps); |
| 57 | 57 | ||
| 58 | // is address breakpoint | 58 | // is address breakpoint |
| 59 | bool IsAddressBreakPoint(u32 iAddress); | 59 | bool IsAddressBreakPoint(u32 iAddress) const; |
| 60 | bool IsTempBreakPoint(u32 iAddress); | 60 | bool IsTempBreakPoint(u32 iAddress) const; |
| 61 | 61 | ||
| 62 | // Add BreakPoint | 62 | // Add BreakPoint |
| 63 | void Add(u32 em_address, bool temp=false); | 63 | void Add(u32 em_address, bool temp=false); |