summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
diff options
context:
space:
mode:
authormitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-03-16 23:05:56 -0700
committermitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-03-28 09:57:22 -0700
commitb52a08d5332949c3b22f8434155cc8095d94df3a (patch)
tree7c62fcc63540d0c1bce670b43f96ffe10ef6ca5f /Source/Core/DolphinQt/Debugger/CodeWidget.cpp
parent1efda863e47b690f460f069502a4391b3c7d87c4 (diff)
DolphinQt: A Ubiquitous Signal For When Symbols Change
There were three distinct mechanisms for signaling symbol changes in DolphinQt: `Host::NotifyMapLoaded`, `MenuBar::NotifySymbolsUpdated`, and `CodeViewWidget::SymbolsChanged`. The behavior of these signals has been consolidated into the new `Host::PPCSymbolsUpdated` signal, which can be emitted from anywhere in DolphinQt to properly update symbols everywhere in DolphinQt.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp28
1 files changed, 12 insertions, 16 deletions
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)