diff --git a/pcsx2-qt/Debugger/DisassemblyWidget.cpp b/pcsx2-qt/Debugger/DisassemblyWidget.cpp index de93c18fae..588c53fc9d 100644 --- a/pcsx2-qt/Debugger/DisassemblyWidget.cpp +++ b/pcsx2-qt/Debugger/DisassemblyWidget.cpp @@ -234,6 +234,11 @@ void DisassemblyWidget::contextAddFunction() } } +void DisassemblyWidget::contextCopyFunctionName() +{ + QGuiApplication::clipboard()->setText(QString::fromStdString(m_cpu->GetSymbolMap().GetLabelName(m_selectedAddressStart))); +} + void DisassemblyWidget::contextRemoveFunction() { u32 curFuncAddr = m_cpu->GetSymbolMap().GetFunctionStart(m_selectedAddressStart); @@ -665,6 +670,11 @@ void DisassemblyWidget::customMenuRequested(QPoint pos) connect(action, &QAction::triggered, this, &DisassemblyWidget::contextCopyInstructionHex); contextMenu->addAction(action = new QAction(tr("Copy Instruction Text"), this)); connect(action, &QAction::triggered, this, &DisassemblyWidget::contextCopyInstructionText); + if (m_selectedAddressStart == m_cpu->GetSymbolMap().GetFunctionStart(m_selectedAddressStart)) + { + contextMenu->addAction(action = new QAction(tr("Copy Function Name"), this)); + connect(action, &QAction::triggered, this, &DisassemblyWidget::contextCopyFunctionName); + } contextMenu->addSeparator(); if (AddressCanRestore(m_selectedAddressStart, m_selectedAddressEnd)) { diff --git a/pcsx2-qt/Debugger/DisassemblyWidget.h b/pcsx2-qt/Debugger/DisassemblyWidget.h index a238c84ec0..6c7586f444 100644 --- a/pcsx2-qt/Debugger/DisassemblyWidget.h +++ b/pcsx2-qt/Debugger/DisassemblyWidget.h @@ -54,6 +54,7 @@ public slots: void contextCopyAddress(); void contextCopyInstructionHex(); void contextCopyInstructionText(); + void contextCopyFunctionName(); void contextAssembleInstruction(); void contextNoopInstruction(); void contextRestoreInstruction();