summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2023-02-12 12:50:28 +0100
committerJosJuice <josjuice@gmail.com>2023-02-12 12:50:28 +0100
commit6f0266e8deb9b9d46fb6f291db696fed06c1bed0 (patch)
tree127e362a81560d3eaa312b84535243a42cbe96da /Source/Core/DolphinQt/Debugger/CodeWidget.cpp
parent7cecb28bdf6443362a6ab20e0042ddb3b407ebec (diff)
DolphinQt: Only update call stack if paused
This avoids a pseudo infinite loop where CodeWidget::UpdateCallstack would lock the CPU in order to read the call stack, causing the CPU to call Host_UpdateDisasmDialog because it's transitioning from running to pausing, causing Host::UpdateDisasmDialog to be emitted, causing CodeWidget::Update to be called, once again causing CodeWidget::UpdateCallstack to be called, repeating the cycle. Dolphin didn't go completely unresponsive during this, because Host_UpdateDisasmDialog schedules the emitting of Host::UpdateDisasmDialog to happen on another thread without blocking, but it was stopping certain operations like exiting emulation from working.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
index 513a68672d..391152abc9 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
@@ -322,11 +322,11 @@ void CodeWidget::Update()
void CodeWidget::UpdateCallstack()
{
- if (Core::GetState() == Core::State::Starting)
- return;
-
m_callstack_list->clear();
+ if (Core::GetState() != Core::State::Paused)
+ return;
+
std::vector<Dolphin_Debugger::CallstackEntry> stack;
const bool success = [&stack] {