summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-04-01 04:32:03 +0200
committerbunnei <bunneidev@gmail.com>2015-04-01 04:32:03 +0200
commitbd7798f94b25ad32bf8884b7f6f7478e020f314d (patch)
treee46b6859d3c48dbc76eeb5af48ea344ec4b36fd5
parentMerge pull request #672 from purpasmart96/citra_moar_app_mem (diff)
parentdisassembler: Get rid of a const_cast (diff)
downloadyuzu-bd7798f94b25ad32bf8884b7f6f7478e020f314d.tar
yuzu-bd7798f94b25ad32bf8884b7f6f7478e020f314d.tar.gz
yuzu-bd7798f94b25ad32bf8884b7f6f7478e020f314d.tar.bz2
yuzu-bd7798f94b25ad32bf8884b7f6f7478e020f314d.tar.lz
yuzu-bd7798f94b25ad32bf8884b7f6f7478e020f314d.tar.xz
yuzu-bd7798f94b25ad32bf8884b7f6f7478e020f314d.tar.zst
yuzu-bd7798f94b25ad32bf8884b7f6f7478e020f314d.zip
-rw-r--r--src/citra_qt/debugger/disassembler.cpp5
-rw-r--r--src/common/break_points.cpp4
-rw-r--r--src/common/break_points.h4
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()
{
ARMword next_instr = Core::g_app_core->GetPC();
- // TODO: Make BreakPoints less crappy (i.e. const-correct) so that this doesn't need a const_cast.
- if (const_cast<BreakPoints&>(model->GetBreakPoints()).IsAddressBreakPoint(next_instr))
- {
+ if (model->GetBreakPoints().IsAddressBreakPoint(next_instr))
emu_thread.SetCpuRunning(false);
- }
model->SetNextInstruction(next_instr);
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 @@
#include <sstream>
#include <algorithm>
-bool BreakPoints::IsAddressBreakPoint(u32 iAddress)
+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);
return it != m_BreakPoints.end();
}
-bool BreakPoints::IsTempBreakPoint(u32 iAddress)
+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);
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:
void AddFromStrings(const TBreakPointsStr& bps);
// is address breakpoint
- bool IsAddressBreakPoint(u32 iAddress);
- bool IsTempBreakPoint(u32 iAddress);
+ bool IsAddressBreakPoint(u32 iAddress) const;
+ bool IsTempBreakPoint(u32 iAddress) const;
// Add BreakPoint
void Add(u32 em_address, bool temp=false);