From ddeb7fbe5369aa83793fdf28cbca23bf3d326b12 Mon Sep 17 00:00:00 2001 From: Dhaval Purohit Date: Sun, 15 Mar 2020 13:51:49 +0100 Subject: [PATCH] Toggle remove option for string definition of instruction (#2059) (#2094) * Toggle remove option for string definition of instruction (#2059) --- src/menus/DisassemblyContextMenu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/menus/DisassemblyContextMenu.cpp b/src/menus/DisassemblyContextMenu.cpp index 08ed16de..257c2eba 100644 --- a/src/menus/DisassemblyContextMenu.cpp +++ b/src/menus/DisassemblyContextMenu.cpp @@ -459,6 +459,10 @@ void DisassemblyContextMenu::aboutToShowSlot() actionAnalyzeFunction.setVisible(true); + // Show the option to remove a defined string only if a string is defined in this address + QString stringDefinition = Core()->cmd("Cs. @ " + RAddressString(offset)); + actionSetAsStringRemove.setVisible(!stringDefinition.isEmpty()); + QString comment = Core()->cmd("CC." + RAddressString(offset)); if (comment.isNull() || comment.isEmpty()) { actionDeleteComment.setVisible(false);