summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-03-31 06:36:09 +0200
committerGitHub <noreply@github.com>2024-03-31 06:36:09 +0200
commita2074a85831b873a5bf3e773ad903622400a3128 (patch)
treed95a3a9da1585bdc638e273bc7f04fe6e172f6d0 /Source/Core
parent6e5f8d669227a7cfea247023c5aa2eeabe54f99a (diff)
parentb52a08d5332949c3b22f8434155cc8095d94df3a (diff)
Merge pull request #12645 from mitaclaw/ppc-symbols-signal
DolphinQt: A Ubiquitous Signal For When Symbols Change
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Boot/Boot.cpp11
-rw-r--r--Source/Core/Core/Boot/Boot.h2
-rw-r--r--Source/Core/Core/ConfigManager.cpp2
-rw-r--r--Source/Core/Core/Host.h2
-rw-r--r--Source/Core/Core/IOS/MIOS.cpp4
-rw-r--r--Source/Core/DolphinNoGUI/MainNoGUI.cpp2
-rw-r--r--Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp8
-rw-r--r--Source/Core/DolphinQt/Debugger/BranchWatchDialog.h2
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp14
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeViewWidget.h1
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp28
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.h1
-rw-r--r--Source/Core/DolphinQt/Host.cpp9
-rw-r--r--Source/Core/DolphinQt/Host.h3
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp6
-rw-r--r--Source/Core/DolphinQt/MenuBar.cpp18
-rw-r--r--Source/Core/DolphinQt/MenuBar.h3
-rw-r--r--Source/Core/DolphinTool/ToolHeadlessPlatform.cpp2
18 files changed, 43 insertions, 75 deletions
diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp
index f1380270a6..538308ef4f 100644
--- a/Source/Core/Core/Boot/Boot.cpp
+++ b/Source/Core/Core/Boot/Boot.cpp
@@ -351,11 +351,6 @@ bool CBoot::DVDReadDiscID(Core::System& system, const DiscIO::VolumeDisc& disc,
return true;
}
-void CBoot::UpdateDebugger_MapLoaded()
-{
- Host_NotifyMapLoaded();
-}
-
// Get map file paths for the active title.
bool CBoot::FindMapFile(std::string* existing_map_file, std::string* writable_map_file)
{
@@ -382,7 +377,7 @@ bool CBoot::LoadMapFromFilename(const Core::CPUThreadGuard& guard, PPCSymbolDB&
bool found = FindMapFile(&strMapFilename, nullptr);
if (found && ppc_symbol_db.LoadMap(guard, strMapFilename))
{
- UpdateDebugger_MapLoaded();
+ Host_PPCSymbolsChanged();
return true;
}
@@ -517,7 +512,7 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
if (auto& ppc_symbol_db = system.GetPPCSymbolDB(); !ppc_symbol_db.IsEmpty())
{
ppc_symbol_db.Clear();
- UpdateDebugger_MapLoaded();
+ Host_PPCSymbolsChanged();
}
// PAL Wii uses NTSC framerate and linecount in 60Hz modes
@@ -597,7 +592,7 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
if (executable.reader->LoadSymbols(guard, system.GetPPCSymbolDB()))
{
- UpdateDebugger_MapLoaded();
+ Host_PPCSymbolsChanged();
HLE::PatchFunctions(system);
}
return true;
diff --git a/Source/Core/Core/Boot/Boot.h b/Source/Core/Core/Boot/Boot.h
index e119cae955..ca27e46963 100644
--- a/Source/Core/Core/Boot/Boot.h
+++ b/Source/Core/Core/Boot/Boot.h
@@ -179,8 +179,6 @@ private:
u32 output_address);
static void RunFunction(Core::System& system, u32 address);
- static void UpdateDebugger_MapLoaded();
-
static bool Boot_WiiWAD(Core::System& system, const DiscIO::VolumeWAD& wad);
static bool BootNANDTitle(Core::System& system, u64 title_id);
diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp
index fb6fda4754..4adb0a240b 100644
--- a/Source/Core/Core/ConfigManager.cpp
+++ b/Source/Core/Core/ConfigManager.cpp
@@ -210,7 +210,7 @@ void SConfig::OnNewTitleLoad(const Core::CPUThreadGuard& guard)
if (!ppc_symbol_db.IsEmpty())
{
ppc_symbol_db.Clear();
- Host_NotifyMapLoaded();
+ Host_PPCSymbolsChanged();
}
CBoot::LoadMapFromFilename(guard, ppc_symbol_db);
HLE::Reload(system);
diff --git a/Source/Core/Core/Host.h b/Source/Core/Core/Host.h
index 9d360d7ec4..8d22e9d59a 100644
--- a/Source/Core/Core/Host.h
+++ b/Source/Core/Core/Host.h
@@ -55,7 +55,7 @@ bool Host_RendererHasFullFocus();
bool Host_RendererIsFullscreen();
void Host_Message(HostMessageID id);
-void Host_NotifyMapLoaded();
+void Host_PPCSymbolsChanged();
void Host_RefreshDSPDebuggerWindow();
void Host_RequestRenderWindowSize(int width, int height);
void Host_UpdateDisasmDialog();
diff --git a/Source/Core/Core/IOS/MIOS.cpp b/Source/Core/Core/IOS/MIOS.cpp
index e4babae253..7722cebea5 100644
--- a/Source/Core/Core/IOS/MIOS.cpp
+++ b/Source/Core/Core/IOS/MIOS.cpp
@@ -74,13 +74,13 @@ bool Load(Core::System& system)
if (!ppc_symbol_db.IsEmpty())
{
ppc_symbol_db.Clear();
- Host_NotifyMapLoaded();
+ Host_PPCSymbolsChanged();
}
if (ppc_symbol_db.LoadMap(guard, File::GetUserPath(D_MAPS_IDX) + "mios-ipl.map"))
{
::HLE::Clear();
::HLE::PatchFunctions(system);
- Host_NotifyMapLoaded();
+ Host_PPCSymbolsChanged();
}
const PowerPC::CoreMode core_mode = power_pc.GetMode();
diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
index 6a0dfd630f..6cbb2750d2 100644
--- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp
+++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
@@ -57,7 +57,7 @@ std::vector<std::string> Host_GetPreferredLocales()
return {};
}
-void Host_NotifyMapLoaded()
+void Host_PPCSymbolsChanged()
{
}
diff --git a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp
index d9ff18db03..5cbd75faac 100644
--- a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp
+++ b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp
@@ -42,6 +42,7 @@
#include "Core/System.h"
#include "DolphinQt/Debugger/BranchWatchTableModel.h"
#include "DolphinQt/Debugger/CodeWidget.h"
+#include "DolphinQt/Host.h"
#include "DolphinQt/QtUtils/DolphinFileDialog.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
@@ -219,6 +220,8 @@ BranchWatchDialog::BranchWatchDialog(Core::System& system, Core::BranchWatch& br
m_table_model->setFont(ui_settings.GetDebugFont());
connect(&ui_settings, &Settings::DebugFontChanged, m_table_model,
&BranchWatchTableModel::setFont);
+ connect(Host::GetInstance(), &Host::PPCSymbolsChanged, m_table_model,
+ &BranchWatchTableModel::UpdateSymbols);
auto* const table_view = new QTableView;
table_view->setModel(m_table_proxy);
@@ -938,11 +941,6 @@ void BranchWatchDialog::Update()
m_table_model->UpdateHits();
}
-void BranchWatchDialog::UpdateSymbols()
-{
- m_table_model->UpdateSymbols();
-}
-
void BranchWatchDialog::UpdateStatus()
{
switch (m_branch_watch.GetRecordingPhase())
diff --git a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.h b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.h
index 22181c0699..dfeff8f4b3 100644
--- a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.h
+++ b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.h
@@ -92,8 +92,6 @@ private:
public:
// TODO: Step doesn't cause EmulationStateChanged to be emitted, so it has to call this manually.
void Update();
- // TODO: There seems to be a lack of a ubiquitous signal for when symbols change.
- void UpdateSymbols();
private:
void UpdateStatus();
diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
index d841ca52af..730180cffd 100644
--- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
@@ -183,6 +183,8 @@ CodeViewWidget::CodeViewWidget()
m_address = m_system.GetPPCState().pc;
Update();
});
+ connect(Host::GetInstance(), &Host::PPCSymbolsChanged, this,
+ qOverload<>(&CodeViewWidget::Update));
connect(&Settings::Instance(), &Settings::ThemeChanged, this,
qOverload<>(&CodeViewWidget::Update));
@@ -884,8 +886,7 @@ void CodeViewWidget::OnAddFunction()
Core::CPUThreadGuard guard(m_system);
m_ppc_symbol_db.AddFunction(guard, addr);
- emit SymbolsChanged();
- Update(&guard);
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void CodeViewWidget::OnInsertBLR()
@@ -934,8 +935,7 @@ void CodeViewWidget::OnRenameSymbol()
if (good && !name.isEmpty())
{
symbol->Rename(name.toStdString());
- emit SymbolsChanged();
- Update();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
}
@@ -973,8 +973,7 @@ void CodeViewWidget::OnSetSymbolSize()
Core::CPUThreadGuard guard(m_system);
PPCAnalyst::ReanalyzeFunction(guard, symbol->address, *symbol, size);
- emit SymbolsChanged();
- Update(&guard);
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void CodeViewWidget::OnSetSymbolEndAddress()
@@ -1001,8 +1000,7 @@ void CodeViewWidget::OnSetSymbolEndAddress()
Core::CPUThreadGuard guard(m_system);
PPCAnalyst::ReanalyzeFunction(guard, symbol->address, *symbol, address - symbol->address);
- emit SymbolsChanged();
- Update(&guard);
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void CodeViewWidget::OnReplaceInstruction()
diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.h b/Source/Core/DolphinQt/Debugger/CodeViewWidget.h
index 9c4c4831b3..2984140b62 100644
--- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.h
+++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.h
@@ -57,7 +57,6 @@ public:
signals:
void RequestPPCComparison(u32 addr);
void ShowMemory(u32 address);
- void SymbolsChanged();
void BreakpointsChanged();
void UpdateCodeWidget();
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
index dbee26c6ec..89811fe421 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
@@ -65,8 +65,6 @@ CodeWidget::CodeWidget(QWidget* parent)
Update();
});
- connect(Host::GetInstance(), &Host::NotifyMapLoaded, this, &CodeWidget::UpdateSymbols);
-
connect(&Settings::Instance(), &Settings::DebugModeToggled, this,
[this](bool enabled) { setHidden(!enabled || !Settings::Instance().IsCodeVisible()); });
@@ -191,15 +189,7 @@ void CodeWidget::ConnectWidgets()
connect(m_function_callers_list, &QListWidget::itemPressed, this,
&CodeWidget::OnSelectFunctionCallers);
- connect(m_code_view, &CodeViewWidget::SymbolsChanged, this, [this]() {
- UpdateCallstack();
- UpdateSymbols();
- if (const Common::Symbol* symbol = m_ppc_symbol_db.GetSymbolFromAddr(m_code_view->GetAddress()))
- {
- UpdateFunctionCalls(symbol);
- UpdateFunctionCallers(symbol);
- }
- });
+ connect(Host::GetInstance(), &Host::PPCSymbolsChanged, this, &CodeWidget::OnPPCSymbolsChanged);
connect(m_code_view, &CodeViewWidget::BreakpointsChanged, this,
[this] { emit BreakpointsChanged(); });
connect(m_code_view, &CodeViewWidget::UpdateCodeWidget, this, &CodeWidget::Update);
@@ -221,6 +211,17 @@ void CodeWidget::OnBranchWatchDialog()
m_branch_watch_dialog->activateWindow();
}
+void CodeWidget::OnPPCSymbolsChanged()
+{
+ UpdateSymbols();
+ UpdateCallstack();
+ if (const Common::Symbol* symbol = m_ppc_symbol_db.GetSymbolFromAddr(m_code_view->GetAddress()))
+ {
+ UpdateFunctionCalls(symbol);
+ UpdateFunctionCallers(symbol);
+ }
+}
+
void CodeWidget::OnSearchAddress()
{
bool good = true;
@@ -389,11 +390,6 @@ void CodeWidget::UpdateSymbols()
}
m_symbols_list->sortItems();
-
- // TODO: There seems to be a lack of a ubiquitous signal for when symbols change.
- // This is the best location to catch the signals from MenuBar and CodeViewWidget.
- if (m_branch_watch_dialog != nullptr)
- m_branch_watch_dialog->UpdateSymbols();
}
void CodeWidget::UpdateFunctionCalls(const Common::Symbol* symbol)
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.h b/Source/Core/DolphinQt/Debugger/CodeWidget.h
index e5465130a2..e9a981f8e5 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.h
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.h
@@ -61,6 +61,7 @@ private:
void UpdateFunctionCalls(const Common::Symbol* symbol);
void UpdateFunctionCallers(const Common::Symbol* symbol);
+ void OnPPCSymbolsChanged();
void OnSearchAddress();
void OnSearchSymbols();
void OnSelectSymbol();
diff --git a/Source/Core/DolphinQt/Host.cpp b/Source/Core/DolphinQt/Host.cpp
index 6cc4b952ed..382e65cc49 100644
--- a/Source/Core/DolphinQt/Host.cpp
+++ b/Source/Core/DolphinQt/Host.cpp
@@ -238,14 +238,9 @@ void Host_UpdateDisasmDialog()
QueueOnObject(QApplication::instance(), [] { emit Host::GetInstance()->UpdateDisasmDialog(); });
}
-void Host::RequestNotifyMapLoaded()
+void Host_PPCSymbolsChanged()
{
- QueueOnObject(QApplication::instance(), [this] { emit NotifyMapLoaded(); });
-}
-
-void Host_NotifyMapLoaded()
-{
- Host::GetInstance()->RequestNotifyMapLoaded();
+ QueueOnObject(QApplication::instance(), [] { emit Host::GetInstance()->PPCSymbolsChanged(); });
}
// We ignore these, and their purpose should be questioned individually.
diff --git a/Source/Core/DolphinQt/Host.h b/Source/Core/DolphinQt/Host.h
index 6af6d60aea..645c4bd54d 100644
--- a/Source/Core/DolphinQt/Host.h
+++ b/Source/Core/DolphinQt/Host.h
@@ -32,14 +32,13 @@ public:
void SetRenderFullFocus(bool focus);
void SetRenderFullscreen(bool fullscreen);
void ResizeSurface(int new_width, int new_height);
- void RequestNotifyMapLoaded();
signals:
void RequestTitle(const QString& title);
void RequestStop();
void RequestRenderSize(int w, int h);
void UpdateDisasmDialog();
- void NotifyMapLoaded();
+ void PPCSymbolsChanged();
private:
Host();
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index 4b70c1cb79..a7e9d5ce61 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -591,12 +591,6 @@ void MainWindow::ConnectMenuBar()
connect(m_game_list, &GameList::SelectionChanged, m_menu_bar, &MenuBar::SelectionChanged);
connect(this, &MainWindow::ReadOnlyModeChanged, m_menu_bar, &MenuBar::ReadOnlyModeChanged);
connect(this, &MainWindow::RecordingStatusChanged, m_menu_bar, &MenuBar::RecordingStatusChanged);
-
- // Symbols
- connect(m_menu_bar, &MenuBar::NotifySymbolsUpdated, [this] {
- m_code_widget->UpdateSymbols();
- m_code_widget->Update();
- });
}
void MainWindow::ConnectHotkeys()
diff --git a/Source/Core/DolphinQt/MenuBar.cpp b/Source/Core/DolphinQt/MenuBar.cpp
index 753e322a89..70e2ad7648 100644
--- a/Source/Core/DolphinQt/MenuBar.cpp
+++ b/Source/Core/DolphinQt/MenuBar.cpp
@@ -1262,7 +1262,7 @@ void MenuBar::ClearSymbols()
return;
Core::System::GetInstance().GetPPCSymbolDB().Clear();
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void MenuBar::GenerateSymbolsFromAddress()
@@ -1275,7 +1275,7 @@ void MenuBar::GenerateSymbolsFromAddress()
PPCAnalyst::FindFunctions(guard, Memory::MEM1_BASE_ADDR,
Memory::MEM1_BASE_ADDR + memory.GetRamSizeReal(), &ppc_symbol_db);
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void MenuBar::GenerateSymbolsFromSignatureDB()
@@ -1304,7 +1304,7 @@ void MenuBar::GenerateSymbolsFromSignatureDB()
tr("'%1' not found, no symbol names generated").arg(QString::fromStdString(TOTALDB)));
}
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void MenuBar::GenerateSymbolsFromRSO()
@@ -1334,7 +1334,7 @@ void MenuBar::GenerateSymbolsFromRSO()
if (rso_chain.Load(guard, static_cast<u32>(address)))
{
rso_chain.Apply(guard, &system.GetPPCSymbolDB());
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
else
{
@@ -1391,7 +1391,7 @@ void MenuBar::GenerateSymbolsFromRSOAuto()
if (rso_chain.Load(guard, address))
{
rso_chain.Apply(guard, &system.GetPPCSymbolDB());
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
else
{
@@ -1541,7 +1541,7 @@ void MenuBar::LoadSymbolMap()
}
HLE::PatchFunctions(system);
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void MenuBar::SaveSymbolMap()
@@ -1566,7 +1566,7 @@ void MenuBar::LoadOtherSymbolMap()
auto& system = Core::System::GetInstance();
HLE::PatchFunctions(system);
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void MenuBar::LoadBadSymbolMap()
@@ -1583,7 +1583,7 @@ void MenuBar::LoadBadSymbolMap()
auto& system = Core::System::GetInstance();
HLE::PatchFunctions(system);
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void MenuBar::SaveSymbolMapAs()
@@ -1708,7 +1708,7 @@ void MenuBar::ApplySignatureFile()
db.Apply(Core::CPUThreadGuard{system}, &system.GetPPCSymbolDB());
db.List();
HLE::PatchFunctions(system);
- emit NotifySymbolsUpdated();
+ emit Host::GetInstance()->PPCSymbolsChanged();
}
void MenuBar::CombineSignatureFiles()
diff --git a/Source/Core/DolphinQt/MenuBar.h b/Source/Core/DolphinQt/MenuBar.h
index d13e8ae4b3..c8a1f6311a 100644
--- a/Source/Core/DolphinQt/MenuBar.h
+++ b/Source/Core/DolphinQt/MenuBar.h
@@ -125,9 +125,6 @@ signals:
void RecordingStatusChanged(bool recording);
void ReadOnlyModeChanged(bool read_only);
- // Synbols
- void NotifySymbolsUpdated();
-
private:
void OnEmulationStateChanged(Core::State state);
diff --git a/Source/Core/DolphinTool/ToolHeadlessPlatform.cpp b/Source/Core/DolphinTool/ToolHeadlessPlatform.cpp
index 2bed042148..8c1772406f 100644
--- a/Source/Core/DolphinTool/ToolHeadlessPlatform.cpp
+++ b/Source/Core/DolphinTool/ToolHeadlessPlatform.cpp
@@ -21,7 +21,7 @@ std::vector<std::string> Host_GetPreferredLocales()
return {};
}
-void Host_NotifyMapLoaded()
+void Host_PPCSymbolsChanged()
{
}