diff --git a/pcsx2/System/SysCoreThread.cpp b/pcsx2/System/SysCoreThread.cpp index 427ed8920a..d69e5014a7 100644 --- a/pcsx2/System/SysCoreThread.cpp +++ b/pcsx2/System/SysCoreThread.cpp @@ -233,7 +233,7 @@ void SysCoreThread::GameStartingInThread() MIPSAnalyst::ScanForFunctions(ElfTextRange.first,ElfTextRange.first+ElfTextRange.second,true); symbolMap.UpdateActiveSymbols(); - //sApp.PostAppMethod(&Pcsx2App::resetDebugger); + sApp.PostAppMethod(&Pcsx2App::resetDebugger); ApplyLoadedPatches(PPT_ONCE_ON_LOAD); #ifdef USE_SAVESLOT_UI_UPDATES diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.cpp b/pcsx2/gui/Debugger/DisassemblyDialog.cpp index bde09c022d..cedf7ff936 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.cpp +++ b/pcsx2/gui/Debugger/DisassemblyDialog.cpp @@ -128,19 +128,29 @@ CpuTabPage::CpuTabPage(wxWindow* parent, DebugInterface* _cpu) mainSizer->Layout(); + symbolCount = 0; + lastCycles = 0; loadCycles(); } +void CpuTabPage::clearSymbolMap() +{ + symbolCount = 0; + functionList->Clear(); +} + void CpuTabPage::reloadSymbolMap() { - functionList->Clear(); - - auto funcs = symbolMap.GetAllSymbols(ST_FUNCTION); - for (size_t i = 0; i < funcs.size(); i++) + if (!symbolCount) { - wxString name = wxString(funcs[i].name.c_str(),wxConvUTF8); - functionList->Append(name,(void*)funcs[i].address); + auto funcs = symbolMap.GetAllSymbols(ST_FUNCTION); + symbolCount = funcs.size(); + for (size_t i = 0; i < funcs.size(); i++) + { + wxString name = wxString(funcs[i].name.c_str(), wxConvUTF8); + functionList->Append(name, (void*)funcs[i].address); + } } } @@ -576,8 +586,14 @@ void DisassemblyDialog::update() void DisassemblyDialog::reset() { eeTab->getDisassembly()->clearFunctions(); - eeTab->reloadSymbolMap(); + eeTab->clearSymbolMap(); iopTab->getDisassembly()->clearFunctions(); + iopTab->clearSymbolMap(); +} + +void DisassemblyDialog::populate() +{ + eeTab->reloadSymbolMap(); iopTab->reloadSymbolMap(); } @@ -614,7 +630,7 @@ void DisassemblyDialog::setDebugMode(bool debugMode, bool switchPC) if (!CBreakPoints::GetBreakpointTriggered()) { wxBusyInfo wait("Please wait, Reading ELF functions"); - reset(); + populate(); } CBreakPoints::ClearTemporaryBreakPoints(); breakRunButton->SetLabel(L"Run"); diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.h b/pcsx2/gui/Debugger/DisassemblyDialog.h index 7c2e241785..1dcb53fce3 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.h +++ b/pcsx2/gui/Debugger/DisassemblyDialog.h @@ -54,6 +54,7 @@ public: void showMemoryView() { setBottomTabPage(memory); }; void loadCycles(); void reloadSymbolMap(); + void clearSymbolMap(); u32 getStepOutAddress(); void listBoxHandler(wxCommandEvent& event); @@ -74,6 +75,7 @@ private: ThreadList* threadList; StackFramesList* stackFrames; u32 lastCycles; + u32 symbolCount; }; class DisassemblyDialog : public wxFrame @@ -87,6 +89,7 @@ public: void update(); void reset(); + void populate(); void setDebugMode(bool debugMode, bool switchPC); #ifdef _WIN32