Only reload the function symbols in debugger once per game

This commit is contained in:
refractionpcsx2 2020-05-02 14:22:43 +01:00 committed by lightningterror
parent 6fc63116bf
commit 5c8c4ce6fb
3 changed files with 28 additions and 9 deletions

View File

@ -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

View File

@ -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");

View File

@ -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