From a67b3479664de7d5b708bd69fb327e81c3ed5fe0 Mon Sep 17 00:00:00 2001 From: Eladash Date: Tue, 23 Mar 2021 12:33:07 +0200 Subject: [PATCH] debugger: Fix SPU memory viewing (#10007) * debugger: Fix SPU memory viewing * Fix terminal recovery from page faults (hack allocation) --- Utilities/Thread.cpp | 4 ++-- rpcs3/rpcs3qt/debugger_list.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 0c187eccb6..62edef9faa 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1409,9 +1409,9 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) no return false; } - if (area->flags & 0x100 || (is_writing && vm::check_addr(addr))) + if (vm::reader_lock rlock; vm::check_addr(addr, 0)) { - // For 4kb pages or read only memory + // For allocated memory with protection lower than required (such as protection::no or read-only while writing to it) utils::memory_protect(vm::base(addr & -0x1000), 0x1000, utils::protection::rw); return true; } diff --git a/rpcs3/rpcs3qt/debugger_list.cpp b/rpcs3/rpcs3qt/debugger_list.cpp index 6bac1cf490..f8397651c0 100644 --- a/rpcs3/rpcs3qt/debugger_list.cpp +++ b/rpcs3/rpcs3qt/debugger_list.cpp @@ -111,7 +111,7 @@ void debugger_list::ShowAddress(u32 addr, bool force) item(i)->setBackground(default_background); } - if (m_cpu->id_type() == 1 && !vm::check_addr(pc)) + if (m_cpu->id_type() == 1 && !vm::check_addr(pc, 0)) { item(i)->setText((IsBreakpoint(pc) ? ">> " : " ") + qstr(fmt::format("[%08x] ?? ?? ?? ??:", pc))); count = 4;