mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Show realname on disassembly context menu (#2049)
* Show realname on disassembly context menu
This commit is contained in:
parent
9b7e3a3a30
commit
dd7e01be3a
@ -329,7 +329,15 @@ QVector<DisassemblyContextMenu::ThingUsedHere> DisassemblyContextMenu::getThingU
|
||||
for (const auto &thing : array) {
|
||||
auto obj = thing.toObject();
|
||||
RVA offset = obj["offset"].toVariant().toULongLong();
|
||||
QString name = obj["name"].toString();
|
||||
QString name;
|
||||
|
||||
// If real names display is enabled, show flag's real name instead of full flag name
|
||||
if (Config()->getConfigBool("asm.flags.real") && obj.contains("realname")) {
|
||||
name = obj["realname"].toString();
|
||||
} else {
|
||||
name = obj["name"].toString();
|
||||
}
|
||||
|
||||
QString typeString = obj["type"].toString();
|
||||
ThingUsedHere::Type type = ThingUsedHere::Type::Address;
|
||||
if (typeString == "var") {
|
||||
@ -477,8 +485,17 @@ void DisassemblyContextMenu::aboutToShowSlot()
|
||||
actionRename.setVisible(true);
|
||||
actionRename.setText(tr("Rename function \"%1\"").arg(fcn->name));
|
||||
} else if (f) {
|
||||
QString name;
|
||||
|
||||
// Check if Realname is enabled. If yes, show it instead of the full flag-name.
|
||||
if (Config()->getConfigBool("asm.flags.real") && f->realname) {
|
||||
name = f->realname;
|
||||
} else {
|
||||
name = f->name;
|
||||
}
|
||||
|
||||
actionRename.setVisible(true);
|
||||
actionRename.setText(tr("Rename flag \"%1\"").arg(f->name));
|
||||
actionRename.setText(tr("Rename flag \"%1\"").arg(name));
|
||||
} else {
|
||||
actionRename.setVisible(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user