MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / contextRenameFunction

Method contextRenameFunction

pcsx2-qt/Debugger/DisassemblyView.cpp:302–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void DisassemblyView::contextRenameFunction()
303{
304 const FunctionInfo curFunc = cpu().GetSymbolGuardian().FunctionOverlappingAddress(m_selectedAddressStart);
305 if (!curFunc.address.valid())
306 {
307 AsyncDialogs::warning(this, tr("Rename Function Error"), tr("No function / symbol is currently selected."));
308 return;
309 }
310
311 const QString title = tr("Rename Function");
312 const QString label = tr("Function name");
313 const QString oldName = QString::fromStdString(curFunc.name);
314
315 AsyncDialogs::getText(this, title, label, oldName, [this, curFunc](QString newName) {
316 if (newName.isEmpty())
317 {
318 AsyncDialogs::warning(this, tr("Rename Function Error"), tr("Function name cannot be nothing."));
319 return;
320 }
321
322 cpu().GetSymbolGuardian().ReadWrite([&](ccc::SymbolDatabase& database) {
323 database.functions.rename_symbol(curFunc.handle, newName.toStdString());
324 });
325 });
326}
327
328void DisassemblyView::contextStubFunction()
329{

Callers

nothing calls this directly

Calls 5

ReadWriteMethod · 0.80
rename_symbolMethod · 0.80
validMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected