mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
Don't ask for confirmation on renaming, don't commit return type
This commit is contained in:
parent
1257f06c17
commit
23cb2634ab
2 changed files with 9 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue