From cbc1ed4bfe44b6c36f44d570620771e4a8633fa7 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 22 Feb 2023 21:14:33 -0800 Subject: [PATCH] Debugger: Lock memory during stack walk. In case of shutdown during it. --- Windows/Debugger/Debugger_Disasm.cpp | 7 +++---- Windows/Debugger/Debugger_Lists.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 584533703d..580166e407 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -291,11 +291,10 @@ void CDisasm::stepOver() UpdateDialog(); } -void CDisasm::stepOut() -{ - if (!PSP_IsInited()) { +void CDisasm::stepOut() { + auto memLock = Memory::Lock(); + if (!PSP_IsInited()) return; - } auto threads = GetThreadsInfo(); diff --git a/Windows/Debugger/Debugger_Lists.cpp b/Windows/Debugger/Debugger_Lists.cpp index 97be390f59..0c76c4d936 100644 --- a/Windows/Debugger/Debugger_Lists.cpp +++ b/Windows/Debugger/Debugger_Lists.cpp @@ -700,8 +700,11 @@ void CtrlStackTraceView::OnDoubleClick(int itemIndex, int column) SendMessage(GetParent(GetHandle()),WM_DEB_GOTOWPARAM,frames[itemIndex].pc,0); } -void CtrlStackTraceView::loadStackTrace() -{ +void CtrlStackTraceView::loadStackTrace() { + auto memLock = Memory::Lock(); + if (!PSP_IsInited()) + return; + auto threads = GetThreadsInfo(); u32 entry = 0, stackTop = 0;