From d946656b873c1e98e5d14fc3033bcf7dfd1a4e7e Mon Sep 17 00:00:00 2001 From: dreamsyntax Date: Fri, 8 Aug 2025 15:43:34 -0700 Subject: [PATCH] PPCSymbolDB: Fix callers not updating Fixes regression from http://github.com/dolphin-emu/dolphin/pull/13821 --- Source/Core/Core/PowerPC/PPCSymbolDB.cpp | 14 +++++++++----- Source/Core/Core/PowerPC/PPCSymbolDB.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/PowerPC/PPCSymbolDB.cpp b/Source/Core/Core/PowerPC/PPCSymbolDB.cpp index 4bfe2abd3d..250d901bc2 100644 --- a/Source/Core/Core/PowerPC/PPCSymbolDB.cpp +++ b/Source/Core/Core/PowerPC/PPCSymbolDB.cpp @@ -236,13 +236,17 @@ std::string PPCSymbolDB::GetDescription(u32 addr) const void PPCSymbolDB::FillInCallers() { std::lock_guard lock(m_mutex); + FillInCallers(&m_functions); +} - for (auto& p : m_functions) +void PPCSymbolDB::FillInCallers(XFuncMap* functions) +{ + for (auto& p : *functions) { p.second.callers.clear(); } - for (auto& entry : m_functions) + for (auto& entry : *functions) { Common::Symbol& f = entry.second; for (const Common::SCall& call : f.calls) @@ -250,8 +254,8 @@ void PPCSymbolDB::FillInCallers() const Common::SCall new_call(entry.first, call.call_address); const u32 function_address = call.function; - auto func_iter = m_functions.find(function_address); - if (func_iter != m_functions.end()) + auto func_iter = functions->find(function_address); + if (func_iter != functions->end()) { Common::Symbol& called_function = func_iter->second; called_function.callers.push_back(new_call); @@ -622,7 +626,7 @@ bool PPCSymbolDB::LoadMap(const Core::CPUThreadGuard& guard, std::string filenam Index(&new_functions); DetermineNoteLayers(&new_notes); - FillInCallers(); + FillInCallers(&new_functions); std::lock_guard lock(m_mutex); std::swap(m_functions, new_functions); diff --git a/Source/Core/Core/PowerPC/PPCSymbolDB.h b/Source/Core/Core/PowerPC/PPCSymbolDB.h index d106f68aa4..8ebc26a810 100644 --- a/Source/Core/Core/PowerPC/PPCSymbolDB.h +++ b/Source/Core/Core/PowerPC/PPCSymbolDB.h @@ -57,4 +57,5 @@ private: static void AddKnownNote(u32 start_addr, u32 size, const std::string& name, XNoteMap* notes); static void DetermineNoteLayers(XNoteMap* notes); + static void FillInCallers(XFuncMap* functions); };