mirror of https://github.com/PCSX2/pcsx2.git
Debugger: Allow copying function names
Add the ability to copy a function name when you right click the first instruction of a function (the line where the function name displays). Instructions inside the function that are not the first instruction will not show the copy option, partly because it's less clear what will be copied but also to not needlessly overpopulate the context menu.
This commit is contained in:
parent
21b3464212
commit
ae2860d03d
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -54,6 +54,7 @@ public slots:
|
|||
void contextCopyAddress();
|
||||
void contextCopyInstructionHex();
|
||||
void contextCopyInstructionText();
|
||||
void contextCopyFunctionName();
|
||||
void contextAssembleInstruction();
|
||||
void contextNoopInstruction();
|
||||
void contextRestoreInstruction();
|
||||
|
|
Loading…
Reference in New Issue