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 authored and refractionpcsx2 committed Apr 8, 2024
1 parent 272c036 commit 91f16ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pcsx2-qt/Debugger/CpuWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ 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);
connect(m_ui.registerWidget, &RegisterWidget::gotoInMemory, this, &CpuWidget::onGotoInMemory);
connect(m_ui.disassemblyWidget, &DisassemblyWidget::gotoInMemory, this, &CpuWidget::onGotoInMemory);

connect(m_ui.memoryviewWidget, &MemoryViewWidget::VMUpdate, this, &CpuWidget::reloadCPUWidgets);
connect(m_ui.registerWidget, &RegisterWidget::VMUpdate, this, &CpuWidget::reloadCPUWidgets);
Expand Down Expand Up @@ -387,6 +387,12 @@ void CpuWidget::onBPListContextMenu(QPoint pos)
contextMenu->popup(m_ui.breakpointList->viewport()->mapToGlobal(pos));
}

void CpuWidget::onGotoInMemory(u32 address)
{
m_ui.memoryviewWidget->gotoAddress(address);
m_ui.tabWidget->setCurrentWidget(m_ui.tab_memory);
}

void CpuWidget::contextBPListCopy()
{
const QItemSelectionModel* selModel = m_ui.breakpointList->selectionModel();
Expand Down Expand Up @@ -752,6 +758,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 +834,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
1 change: 1 addition & 0 deletions pcsx2-qt/Debugger/CpuWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public slots:
void updateBreakpoints();
void onBPListDoubleClicked(const QModelIndex& index);
void onBPListContextMenu(QPoint pos);
void onGotoInMemory(u32 address);

void contextBPListCopy();
void contextBPListDelete();
Expand Down

0 comments on commit 91f16ae

Please sign in to comment.