summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorSepalani <sepalani@hotmail.fr>2021-02-14 16:01:32 +0400
committerSepalani <sepalani@hotmail.fr>2021-02-14 16:01:32 +0400
commit5f629abd8b89971872b0c2c2cdc8ea0035e8998d (patch)
tree6085b0430e12cc3b82df88077cae9af3742e4a69 /Source
parent2f85b80b7bf75434072c1245904587ee8c15fbe2 (diff)
CodeViewWidget: Add WithDetailedUpdate to update CodeWidget
This used to also update the function calls and callers.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp17
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeViewWidget.h4
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp1
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp6
4 files changed, 21 insertions, 7 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
index 1b0224f0c4..203b54450e 100644
--- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
@@ -442,8 +442,19 @@ void CodeViewWidget::SetAddress(u32 address, SetAddressUpdate update)
return;
m_address = address;
- if (update == SetAddressUpdate::WithUpdate)
+ switch (update)
+ {
+ case SetAddressUpdate::WithoutUpdate:
+ return;
+ case SetAddressUpdate::WithUpdate:
+ // Update the CodeViewWidget
Update();
+ break;
+ case SetAddressUpdate::WithDetailedUpdate:
+ // Update the CodeWidget's views (code view, function calls/callers, ...)
+ emit UpdateCodeWidget();
+ break;
+ }
}
void CodeViewWidget::ReplaceAddress(u32 address, ReplaceWith replace)
@@ -611,7 +622,7 @@ void CodeViewWidget::OnFollowBranch()
if (!branch_addr)
return;
- SetAddress(branch_addr, SetAddressUpdate::WithUpdate);
+ SetAddress(branch_addr, SetAddressUpdate::WithDetailedUpdate);
}
void CodeViewWidget::OnRenameSymbol()
@@ -785,7 +796,7 @@ void CodeViewWidget::mousePressEvent(QMouseEvent* event)
if (column(item) == CODE_VIEW_COLUMN_BREAKPOINT)
ToggleBreakpoint();
else
- SetAddress(addr, SetAddressUpdate::WithUpdate);
+ SetAddress(addr, SetAddressUpdate::WithDetailedUpdate);
Update();
break;
diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.h b/Source/Core/DolphinQt/Debugger/CodeViewWidget.h
index eddb3b09f7..e2d5ff4102 100644
--- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.h
+++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.h
@@ -25,7 +25,8 @@ public:
enum class SetAddressUpdate
{
WithUpdate,
- WithoutUpdate
+ WithoutUpdate,
+ WithDetailedUpdate
};
explicit CodeViewWidget();
@@ -49,6 +50,7 @@ signals:
void ShowMemory(u32 address);
void SymbolsChanged();
void BreakpointsChanged();
+ void UpdateCodeWidget();
private:
enum class ReplaceWith
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
index 4232a40695..627f5f2568 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
@@ -170,6 +170,7 @@ void CodeWidget::ConnectWidgets()
connect(m_code_view, &CodeViewWidget::SymbolsChanged, this, &CodeWidget::UpdateSymbols);
connect(m_code_view, &CodeViewWidget::BreakpointsChanged, this,
[this] { emit BreakpointsChanged(); });
+ connect(m_code_view, &CodeViewWidget::UpdateCodeWidget, this, &CodeWidget::Update);
connect(m_code_view, &CodeViewWidget::RequestPPCComparison, this,
&CodeWidget::RequestPPCComparison);
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index 8e1536b0e4..3c6cb44560 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -419,7 +419,7 @@ void MainWindow::CreateComponents()
};
const auto request_view_in_memory = [this](u32 addr) { m_memory_widget->SetAddress(addr); };
const auto request_view_in_code = [this](u32 addr) {
- m_code_widget->SetAddress(addr, CodeViewWidget::SetAddressUpdate::WithUpdate);
+ m_code_widget->SetAddress(addr, CodeViewWidget::SetAddressUpdate::WithDetailedUpdate);
};
connect(m_watch_widget, &WatchWidget::RequestMemoryBreakpoint, request_memory_breakpoint);
@@ -439,7 +439,7 @@ void MainWindow::CreateComponents()
connect(m_memory_widget, &MemoryWidget::BreakpointsChanged, m_breakpoint_widget,
&BreakpointWidget::Update);
connect(m_memory_widget, &MemoryWidget::ShowCode, m_code_widget, [this](u32 address) {
- m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithUpdate);
+ m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithDetailedUpdate);
});
connect(m_breakpoint_widget, &BreakpointWidget::BreakpointsChanged, m_code_widget,
@@ -448,7 +448,7 @@ void MainWindow::CreateComponents()
&MemoryWidget::Update);
connect(m_breakpoint_widget, &BreakpointWidget::SelectedBreakpoint, [this](u32 address) {
if (Core::GetState() == Core::State::Paused)
- m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithUpdate);
+ m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithDetailedUpdate);
});
}