mirror of https://github.com/PCSX2/pcsx2.git
Debugger: Allow copying address of memory search results
Adds the ability to copy the address directly of a memory search result through the right click context menu.
This commit is contained in:
parent
49df804d1b
commit
be208df11b
|
@ -592,6 +592,17 @@ void CpuWidget::contextRemoveSearchResult()
|
||||||
delete rowToRemove;
|
delete rowToRemove;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CpuWidget::contextCopySearchResultAddress()
|
||||||
|
{
|
||||||
|
if (!m_ui.listSearchResults->selectionModel()->hasSelection())
|
||||||
|
return;
|
||||||
|
|
||||||
|
const u32 selectedResultIndex = m_ui.listSearchResults->row(m_ui.listSearchResults->selectedItems().first());
|
||||||
|
const u32 rowAddress = m_ui.listSearchResults->item(selectedResultIndex)->data(Qt::UserRole).toUInt();
|
||||||
|
const QString addressString = FilledQStringFromValue(rowAddress, 16);
|
||||||
|
QApplication::clipboard()->setText(addressString);
|
||||||
|
}
|
||||||
|
|
||||||
void CpuWidget::updateFunctionList(bool whenEmpty)
|
void CpuWidget::updateFunctionList(bool whenEmpty)
|
||||||
{
|
{
|
||||||
if (!m_cpu.isAlive())
|
if (!m_cpu.isAlive())
|
||||||
|
@ -894,6 +905,10 @@ void CpuWidget::onListSearchResultsContextMenu(QPoint pos)
|
||||||
|
|
||||||
if (selModel->hasSelection())
|
if (selModel->hasSelection())
|
||||||
{
|
{
|
||||||
|
QAction* copyAddressAction = new QAction(tr("Copy Address"), m_ui.listSearchResults);
|
||||||
|
connect(copyAddressAction, &QAction::triggered, this, &CpuWidget::contextCopySearchResultAddress);
|
||||||
|
contextMenu->addAction(copyAddressAction);
|
||||||
|
|
||||||
QAction* goToDisassemblyAction = new QAction(tr("Go to in Disassembly"), m_ui.listSearchResults);
|
QAction* goToDisassemblyAction = new QAction(tr("Go to in Disassembly"), m_ui.listSearchResults);
|
||||||
connect(goToDisassemblyAction, &QAction::triggered, this, &CpuWidget::contextSearchResultGoToDisassembly);
|
connect(goToDisassemblyAction, &QAction::triggered, this, &CpuWidget::contextSearchResultGoToDisassembly);
|
||||||
contextMenu->addAction(goToDisassemblyAction);
|
contextMenu->addAction(goToDisassemblyAction);
|
||||||
|
|
|
@ -116,6 +116,7 @@ public slots:
|
||||||
void loadSearchResults();
|
void loadSearchResults();
|
||||||
void contextSearchResultGoToDisassembly();
|
void contextSearchResultGoToDisassembly();
|
||||||
void contextRemoveSearchResult();
|
void contextRemoveSearchResult();
|
||||||
|
void contextCopySearchResultAddress();
|
||||||
void onListSearchResultsContextMenu(QPoint pos);
|
void onListSearchResultsContextMenu(QPoint pos);
|
||||||
|
|
||||||
void saveBreakpointsToDebuggerSettings();
|
void saveBreakpointsToDebuggerSettings();
|
||||||
|
|
Loading…
Reference in New Issue