summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2022-12-07 19:55:04 +0100
committerGitHub <noreply@github.com>2022-12-07 19:55:04 +0100
commitb207611c3393701adee81fc790d9015083f2b902 (patch)
treeb4b14613a3b585f90dcf1a26b6b558130570e1ad /Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp
parent000c6c48137028284598043d6f116ac959f41042 (diff)
parenta17fbe7c6566682ef88119875b9ce0f719ebf257 (diff)
Merge pull request #11274 from TryTwo/PR_Conditional_BP_Add_Memory
Debugger: Add conditional breakpoints to memory BPs
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp
index fcc989f80a..019494491b 100644
--- a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp
@@ -255,6 +255,13 @@ void BreakpointWidget::Update()
m_table->setItem(i, 4, create_item(flags));
+ QString condition;
+
+ if (mbp.condition)
+ condition = QString::fromStdString(mbp.condition->GetText());
+
+ m_table->setItem(i, 5, create_item(condition));
+
i++;
}
}
@@ -430,7 +437,7 @@ void BreakpointWidget::AddBP(u32 addr, bool temp, bool break_on_hit, bool log_on
}
void BreakpointWidget::AddAddressMBP(u32 addr, bool on_read, bool on_write, bool do_log,
- bool do_break)
+ bool do_break, const QString& condition)
{
TMemCheck check;
@@ -441,10 +448,11 @@ void BreakpointWidget::AddAddressMBP(u32 addr, bool on_read, bool on_write, bool
check.is_break_on_write = on_write;
check.log_on_hit = do_log;
check.break_on_hit = do_break;
-
+ check.condition =
+ !condition.isEmpty() ? Expression::TryParse(condition.toUtf8().constData()) : std::nullopt;
{
const QSignalBlocker blocker(Settings::Instance());
- PowerPC::memchecks.Add(check);
+ PowerPC::memchecks.Add(std::move(check));
}
emit BreakpointsChanged();
@@ -452,7 +460,7 @@ void BreakpointWidget::AddAddressMBP(u32 addr, bool on_read, bool on_write, bool
}
void BreakpointWidget::AddRangedMBP(u32 from, u32 to, bool on_read, bool on_write, bool do_log,
- bool do_break)
+ bool do_break, const QString& condition)
{
TMemCheck check;
@@ -463,10 +471,11 @@ void BreakpointWidget::AddRangedMBP(u32 from, u32 to, bool on_read, bool on_writ
check.is_break_on_write = on_write;
check.log_on_hit = do_log;
check.break_on_hit = do_break;
-
+ check.condition =
+ !condition.isEmpty() ? Expression::TryParse(condition.toUtf8().constData()) : std::nullopt;
{
const QSignalBlocker blocker(Settings::Instance());
- PowerPC::memchecks.Add(check);
+ PowerPC::memchecks.Add(std::move(check));
}
emit BreakpointsChanged();