From fbea8f438df4bef4b56399c7d6dd529c9ab0ce96 Mon Sep 17 00:00:00 2001 From: shenweip <1037567878@qq.com> Date: Sat, 12 Sep 2020 19:45:25 +0800 Subject: [PATCH] Update symbol list of disassembly window when loadexec. --- Core/HLE/sceKernelModule.cpp | 2 ++ Core/Host.h | 1 + Qt/QtHost.h | 3 +++ UI/HostTypes.h | 1 + UWP/UWPHost.cpp | 4 ++++ UWP/UWPHost.h | 1 + Windows/WindowsHost.cpp | 5 +++++ Windows/WindowsHost.h | 1 + headless/StubHost.h | 1 + 9 files changed, 19 insertions(+) diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 3f34ea3d38..34b3a9bc3c 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -1743,6 +1743,8 @@ bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_str return false; } + host->NotifySymbolMapUpdated(); + mipsr4k.pc = module->nm.entry_addr; INFO_LOG(LOADER, "Module entry: %08x", mipsr4k.pc); diff --git a/Core/Host.h b/Core/Host.h index 2fd79e9510..35838c8083 100644 --- a/Core/Host.h +++ b/Core/Host.h @@ -48,6 +48,7 @@ public: virtual bool IsDebuggingEnabled() {return true;} virtual bool AttemptLoadSymbolMap(); virtual void SaveSymbolMap() {} + virtual void NotifySymbolMapUpdated() {} virtual void SetWindowTitle(const char *message) {} virtual bool CanCreateShortcut() {return false;} diff --git a/Qt/QtHost.h b/Qt/QtHost.h index 1a15740806..e0c7ef4b7e 100644 --- a/Qt/QtHost.h +++ b/Qt/QtHost.h @@ -67,6 +67,9 @@ public: auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart); return g_symbolMap->LoadSymbolMap(fn.c_str()); } + + virtual void NotifySymbolMapUpdated() override { g_symbolMap->SortSymbols(); } + void PrepareShutdown() { auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart); g_symbolMap->SaveSymbolMap(fn.c_str()); diff --git a/UI/HostTypes.h b/UI/HostTypes.h index e489aa668d..134c808862 100644 --- a/UI/HostTypes.h +++ b/UI/HostTypes.h @@ -43,6 +43,7 @@ public: bool IsDebuggingEnabled() override {return false;} bool AttemptLoadSymbolMap() override {return false;} + void NotifySymbolMapUpdated() override {} void SetWindowTitle(const char *message) override {} void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override { diff --git a/UWP/UWPHost.cpp b/UWP/UWPHost.cpp index 49bc413d4f..5edd05cd3b 100644 --- a/UWP/UWPHost.cpp +++ b/UWP/UWPHost.cpp @@ -158,6 +158,10 @@ void UWPHost::SaveSymbolMap() { g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(), ".ppmap").c_str()); } +void UWPHost::NotifySymbolMapUpdated() { + g_symbolMap->SortSymbols(); +} + bool UWPHost::IsDebuggingEnabled() { return false; } diff --git a/UWP/UWPHost.h b/UWP/UWPHost.h index 597886189e..3c70db9991 100644 --- a/UWP/UWPHost.h +++ b/UWP/UWPHost.h @@ -30,6 +30,7 @@ public: void BootDone() override; bool AttemptLoadSymbolMap() override; void SaveSymbolMap() override; + void NotifySymbolMapUpdated() override; void SetWindowTitle(const char *message) override; void ToggleDebugConsoleVisibility() override; diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index e197877ce7..48b79bde30 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -312,6 +312,11 @@ void WindowsHost::SaveSymbolMap() { g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str()); } +void WindowsHost::NotifySymbolMapUpdated() { + g_symbolMap->SortSymbols(); + PostMessage(mainWindow_, WM_USER + 1, 0, 0); +} + bool WindowsHost::IsDebuggingEnabled() { #ifdef _DEBUG return true; diff --git a/Windows/WindowsHost.h b/Windows/WindowsHost.h index 7c96fe6631..581a8064d3 100644 --- a/Windows/WindowsHost.h +++ b/Windows/WindowsHost.h @@ -52,6 +52,7 @@ public: void BootDone() override; bool AttemptLoadSymbolMap() override; void SaveSymbolMap() override; + void NotifySymbolMapUpdated() override; void SetWindowTitle(const char *message) override; void ToggleDebugConsoleVisibility() override; diff --git a/headless/StubHost.h b/headless/StubHost.h index d6498e2b0f..8ac54ddff8 100644 --- a/headless/StubHost.h +++ b/headless/StubHost.h @@ -44,6 +44,7 @@ public: bool IsDebuggingEnabled() override { return false; } bool AttemptLoadSymbolMap() override { g_symbolMap->Clear(); return false; } + void NotifySymbolMapUpdated() override {} bool ShouldSkipUI() override { return true; }