Expand conditional breakpoints to memory breakpoints

This commit is contained in:
TryTwo
2022-09-02 02:57:30 -07:00
parent 6abcaadd5a
commit a17fbe7c65
9 changed files with 88 additions and 49 deletions

View File

@ -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();