Skip to content

Commit

Permalink
Debugger/CPUWidget: Make "Go to in Memory View" open the Memory View
Browse files Browse the repository at this point in the history
  • Loading branch information
CookiePLMonster committed Apr 7, 2024
1 parent 895bd34 commit 6e0e939
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pcsx2-qt/Debugger/CpuWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ CpuWidget::CpuWidget(QWidget* parent, DebugInterface& cpu)
connect(m_ui.memoryviewWidget, &MemoryViewWidget::gotoInDisasm, m_ui.disassemblyWidget, &DisassemblyWidget::gotoAddress);
connect(m_ui.memoryviewWidget, &MemoryViewWidget::addToSavedAddresses, this, &CpuWidget::addAddressToSavedAddressesList);

connect(m_ui.registerWidget, &RegisterWidget::gotoInMemory, m_ui.memoryviewWidget, &MemoryViewWidget::gotoAddress);
connect(m_ui.disassemblyWidget, &DisassemblyWidget::gotoInMemory, m_ui.memoryviewWidget, &MemoryViewWidget::gotoAddress);
auto gotoAddress = [this](u32 address) {
m_ui.memoryviewWidget->gotoAddress(address);
m_ui.tabWidget->setCurrentWidget(m_ui.tab_memory);
};
connect(m_ui.registerWidget, &RegisterWidget::gotoInMemory, this, gotoAddress);
connect(m_ui.disassemblyWidget, &DisassemblyWidget::gotoInMemory, this, gotoAddress);

connect(m_ui.memoryviewWidget, &MemoryViewWidget::VMUpdate, this, &CpuWidget::reloadCPUWidgets);
connect(m_ui.registerWidget, &RegisterWidget::VMUpdate, this, &CpuWidget::reloadCPUWidgets);
Expand Down Expand Up @@ -752,6 +756,7 @@ void CpuWidget::onFuncListContextMenu(QPoint pos)
QAction* gotoMemory = new QAction(tr("Go to in Memory View"), m_ui.listFunctions);
connect(gotoMemory, &QAction::triggered, [this] {
m_ui.memoryviewWidget->gotoAddress(m_ui.listFunctions->selectedItems().first()->data(Qt::UserRole).toUInt());
m_ui.tabWidget->setCurrentWidget(m_ui.tab_memory);
});

m_funclistContextMenu->addAction(gotoMemory);
Expand Down Expand Up @@ -827,6 +832,7 @@ void CpuWidget::onModuleTreeContextMenu(QPoint pos)
QAction* gotoMemory = new QAction(tr("Go to in Memory View"), m_ui.treeModules);
connect(gotoMemory, &QAction::triggered, [this] {
m_ui.memoryviewWidget->gotoAddress(m_ui.treeModules->selectedItems().first()->data(0, Qt::UserRole).toUInt());
m_ui.tabWidget->setCurrentWidget(m_ui.tab_memory);
});
m_moduleTreeContextMenu->addAction(gotoMemory);
}
Expand Down

0 comments on commit 6e0e939

Please sign in to comment.