summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2025-03-22 12:13:48 +0100
committerJosJuice <josjuice@gmail.com>2025-03-23 15:29:19 +0100
commit303366b1ce2e93ff33bac1afc42251f281073f9b (patch)
tree1d9a588b97d8578ce09d3c56eac9c02a79db19d4 /Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
parent049e52ce1cd3f075f6992d591bdf2ce5ecbdea0f (diff)
PowerPC: Add RAII handling for breakpoint updates
bbf72e7 made a change where you can pass `false` to certain MemChecks functions to get them to skip performing an "update" step. It was then up to the caller to call the Update function later. This commit changes the implementation so that, instead of the caller passing in a boolean that controls whether a function calls Update, the function now returns an object that on destruction will call Update. Callers that are fine with Update being called right away can skip storing the object in a variable and thereby call Update immediately, and callers that want to call Update later can keep the object around. This new design reduces the risk that someone will forget calling Update.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
index 75cafdd814..7d8c506ecc 100644
--- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
@@ -996,6 +996,7 @@ void MemoryViewWidget::ToggleBreakpoint(u32 addr, bool row)
{
const Core::CPUThreadGuard guard(m_system);
+ DelayedMemCheckUpdate delayed_update(&memchecks);
for (int i = 0; i < breaks; i++)
{
@@ -1014,16 +1015,14 @@ void MemoryViewWidget::ToggleBreakpoint(u32 addr, bool row)
check.log_on_hit = m_do_log;
check.break_on_hit = true;
- memchecks.Add(std::move(check), false);
+ delayed_update |= memchecks.Add(std::move(check));
}
else if (check_ptr != nullptr)
{
// Using the pointer fixes misaligned breakpoints (0x11 breakpoint in 0x10 aligned view).
- memchecks.Remove(check_ptr->start_address, false);
+ delayed_update |= memchecks.Remove(check_ptr->start_address);
}
}
-
- memchecks.Update();
}
emit Host::GetInstance()->PPCBreakpointsChanged();