mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-20 13:46:06 +00:00
Fix rename function
This commit is contained in:
parent
ad6a357c22
commit
d276e438e8
@ -314,10 +314,15 @@ void CutterCore::analyze(int level, QList<QString> advanced)
|
||||
}
|
||||
}
|
||||
|
||||
void CutterCore::renameFunction(QString prev_name, QString new_name)
|
||||
void CutterCore::renameFunction(QString old_name, QString new_name)
|
||||
{
|
||||
cmd("afn " + new_name + " " + prev_name);
|
||||
emit functionRenamed(prev_name, new_name);
|
||||
cmd("afn " + new_name + " " + old_name);
|
||||
emit functionRenamed(old_name, new_name);
|
||||
}
|
||||
|
||||
void CutterCore::renameFlag(QString old_name, QString new_name)
|
||||
{
|
||||
cmd("fr " + old_name + " " + new_name);
|
||||
}
|
||||
|
||||
void CutterCore::setComment(RVA addr, QString cmt)
|
||||
|
@ -200,6 +200,7 @@ public:
|
||||
QJsonDocument cmdj(const QString &str);
|
||||
QStringList cmdList(const QString &str) { auto l = cmd(str).split("\n"); l.removeAll(""); return l; }
|
||||
void renameFunction(QString prev_name, QString new_name);
|
||||
void renameFlag(QString old_name, QString new_name);
|
||||
void setComment(RVA addr, QString cmt);
|
||||
void delComment(ut64 addr);
|
||||
QMap<QString, QList<QList<QString>>> getNestedComments();
|
||||
|
@ -40,7 +40,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="text">
|
||||
<string>Function name:</string>
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -172,7 +172,7 @@ void DisassemblyContextMenu::on_actionRename_triggered()
|
||||
dialog->setName(f->name);
|
||||
if (dialog->exec()) {
|
||||
QString new_name = dialog->getName();
|
||||
Core()->renameFunction(f->name, new_name);
|
||||
Core()->renameFlag(f->name, new_name);
|
||||
}
|
||||
} else {
|
||||
/* Create new flag */
|
||||
|
Loading…
Reference in New Issue
Block a user