| 300 | } |
| 301 | |
| 302 | void 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 | |
| 328 | void DisassemblyView::contextStubFunction() |
| 329 | { |
nothing calls this directly
no test coverage detected