mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-19 16:40:38 -09:00
GP-4324 Improved Function Editor for Decompiler use to limit full commit and added checkbox to control full commit
This commit is contained in:
@@ -111,7 +111,7 @@ public interface Function extends Namespace {
|
||||
|
||||
/**
|
||||
* Returns the current call-fixup name set on this instruction or null if one has not been set
|
||||
* @return the name
|
||||
* @return the call fixup name or null
|
||||
*/
|
||||
public String getCallFixup();
|
||||
|
||||
|
||||
@@ -614,7 +614,7 @@ public class VariableUtilities {
|
||||
}
|
||||
|
||||
if (conflicts != null) {
|
||||
generateConflictException(newStorage, conflicts, 4);
|
||||
generateConflictException(var, newStorage, conflicts, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,8 +622,8 @@ public class VariableUtilities {
|
||||
* Check for variable storage conflict and optionally remove conflicting variables.
|
||||
* @param existingVariables variables to check (may contain null entries)
|
||||
* @param var function variable
|
||||
* @param conflictHandler variable conflict handler
|
||||
* @param newStorage variable storage
|
||||
* @param conflictHandler variable conflict handler
|
||||
* @throws VariableSizeException if another variable conflicts
|
||||
*/
|
||||
public static void checkVariableConflict(List<? extends Variable> existingVariables,
|
||||
@@ -653,7 +653,7 @@ public class VariableUtilities {
|
||||
|
||||
if (conflicts != null) {
|
||||
if (conflictHandler == null || !conflictHandler.resolveConflicts(conflicts)) {
|
||||
generateConflictException(newStorage, conflicts, 4);
|
||||
generateConflictException(var, newStorage, conflicts, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -667,18 +667,33 @@ public class VariableUtilities {
|
||||
boolean resolveConflicts(List<Variable> conflicts);
|
||||
}
|
||||
|
||||
private static void generateConflictException(VariableStorage newStorage,
|
||||
private static void appendVariableStorageDetails(Variable var, VariableStorage storage,
|
||||
StringBuilder msg) {
|
||||
if (var != null) {
|
||||
msg.append(var.getName());
|
||||
msg.append("{");
|
||||
msg.append(storage);
|
||||
msg.append("}");
|
||||
}
|
||||
else {
|
||||
msg.append(storage);
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateConflictException(Variable var, VariableStorage newStorage,
|
||||
List<Variable> conflicts, int maxConflictVarDetails) throws VariableSizeException {
|
||||
|
||||
maxConflictVarDetails = Math.min(conflicts.size(), maxConflictVarDetails);
|
||||
|
||||
StringBuffer msg = new StringBuffer();
|
||||
msg.append("Variable storage conflict between " + newStorage + " and: ");
|
||||
StringBuilder msg = new StringBuilder("Variable storage conflict between ");
|
||||
appendVariableStorageDetails(var, newStorage, msg);
|
||||
msg.append(" and ");
|
||||
for (int i = 0; i < maxConflictVarDetails; i++) {
|
||||
if (i != 0) {
|
||||
msg.append(", ");
|
||||
}
|
||||
msg.append(conflicts.get(i).getVariableStorage().toString());
|
||||
Variable v = conflicts.get(i);
|
||||
appendVariableStorageDetails(v, v.getVariableStorage(), msg);
|
||||
}
|
||||
if (maxConflictVarDetails < conflicts.size()) {
|
||||
msg.append(" ... {");
|
||||
|
||||
Reference in New Issue
Block a user