Skip to content

Ghidra is a software reverse engineering (SRE) framework

Don't ask for confirmation on renaming, don't commit return type

caheckman23cb2634ab4a
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RenameVariableTask.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RenameVariableTask.java
index 2850141631..0a2e9181c1 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RenameVariableTask.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RenameVariableTask.java
@@ -15,7 +15,6 @@
*/
package ghidra.app.plugin.core.decompile.actions;
-import docking.widgets.OptionDialog;
import ghidra.framework.plugintool.PluginTool;
import ghidra.program.model.listing.Function;
import ghidra.program.model.listing.Program;
@@ -69,13 +68,6 @@ public class RenameVariableTask extends RenameTask {
}
commitRequired = RetypeVariableAction.checkFullCommit(var, hfunction);
if (commitRequired) {
- int resp =
- OptionDialog.showOptionDialog(tool.getToolFrame(), "Parameter Commit Required",
- "Renaming a parameter requires all other parameters to be committed!\nContinue with rename?",
- "Continue");
- if (resp != OptionDialog.OPTION_ONE) {
- return false;
- }
exactSpot = null; // Don't try to split out if we need to commit
}
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RetypeVariableAction.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RetypeVariableAction.java
index d3667d526b..c1869ba2fd 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RetypeVariableAction.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RetypeVariableAction.java
@@ -157,10 +157,17 @@ public class RetypeVariableAction extends AbstractDecompilerAction {
dt = dataTypeManager.resolve(dt, null);
}
if (commitRequired) {
+ // Don't use datatypes of other parameters if the datatypes were floating.
+ // Datatypes were floating if signature source was DEFAULT
+ boolean useDataTypes =
+ hfunction.getFunction().getSignatureSource() != SourceType.DEFAULT;
try {
- HighFunctionDBUtil.commitParamsToDatabase(hfunction, true,
+ HighFunctionDBUtil.commitParamsToDatabase(hfunction, useDataTypes,
SourceType.USER_DEFINED);
- HighFunctionDBUtil.commitReturnToDatabase(hfunction, SourceType.USER_DEFINED);
+ if (useDataTypes) {
+ HighFunctionDBUtil.commitReturnToDatabase(hfunction,
+ SourceType.USER_DEFINED);
+ }
}
catch (DuplicateNameException e) {
throw new AssertException("Unexpected exception", e);