From 6f0266e8deb9b9d46fb6f291db696fed06c1bed0 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 12 Feb 2023 12:50:28 +0100 Subject: [PATCH] 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. --- Source/Core/DolphinQt/Debugger/CodeWidget.cpp | 6 +++--- 1 file 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 stack; const bool success = [&stack] {