GP-0 corrected additional diff apply failures

This commit is contained in:
James 2024-12-17 17:52:27 +00:00
parent 5a156112a0
commit 18b1d9e6c6
3 changed files with 18 additions and 4 deletions

View file

@ -20,6 +20,7 @@ import ghidra.framework.plugintool.Plugin;
import ghidra.framework.plugintool.PluginTool; import ghidra.framework.plugintool.PluginTool;
import ghidra.program.util.ProgramMergeFilter; import ghidra.program.util.ProgramMergeFilter;
import ghidra.util.HelpLocation; import ghidra.util.HelpLocation;
import ghidra.util.Msg;
/** /**
* Manages the options for the Diff apply settings. * Manages the options for the Diff apply settings.
@ -396,6 +397,8 @@ class DiffApplySettingsOptionManager {
return ProgramMergeFilter.SYMBOLS; return ProgramMergeFilter.SYMBOLS;
case FUNCTION_TAGS: case FUNCTION_TAGS:
return ProgramMergeFilter.FUNCTION_TAGS; return ProgramMergeFilter.FUNCTION_TAGS;
case SOURCE_MAP:
return ProgramMergeFilter.SOURCE_MAP;
default: default:
return 0; return 0;
} }
@ -436,6 +439,8 @@ class DiffApplySettingsOptionManager {
return OPTION_SYMBOLS; return OPTION_SYMBOLS;
case FUNCTION_TAGS: case FUNCTION_TAGS:
return OPTION_FUNCTION_TAGS; return OPTION_FUNCTION_TAGS;
case SOURCE_MAP:
return OPTION_SOURCE_MAP;
default: default:
return null; return null;
} }
@ -520,6 +525,7 @@ class DiffApplySettingsOptionManager {
private REPLACE_CHOICE convertTypeToReplaceEnum(ProgramMergeFilter defaultApplyFilter, private REPLACE_CHOICE convertTypeToReplaceEnum(ProgramMergeFilter defaultApplyFilter,
int type) { int type) {
int filter = defaultApplyFilter.getFilter(type); int filter = defaultApplyFilter.getFilter(type);
Msg.info(this, "type: " + Integer.toHexString(filter) + " filter: " + filter);
return REPLACE_CHOICE.values()[filter]; return REPLACE_CHOICE.values()[filter];
} }

View file

@ -48,6 +48,7 @@ public class DiffApplyTestAdapter extends DiffTestAdapter {
JComboBox<?> bookmarkApplyCB; JComboBox<?> bookmarkApplyCB;
JComboBox<?> propertiesApplyCB; JComboBox<?> propertiesApplyCB;
JComboBox<?> functionTagApplyCB; JComboBox<?> functionTagApplyCB;
JComboBox<?> sourceMapApplyCB;
public DiffApplyTestAdapter() { public DiffApplyTestAdapter() {
super(); super();
@ -222,6 +223,8 @@ public class DiffApplyTestAdapter extends DiffTestAdapter {
(JComboBox<?>) findComponentByName(settingsPanel, "Properties Diff Apply CB"); (JComboBox<?>) findComponentByName(settingsPanel, "Properties Diff Apply CB");
functionTagApplyCB = functionTagApplyCB =
(JComboBox<?>) findComponentByName(settingsPanel, "Function Tags Diff Apply CB"); (JComboBox<?>) findComponentByName(settingsPanel, "Function Tags Diff Apply CB");
sourceMapApplyCB =
(JComboBox<?>) findComponentByName(settingsPanel, "Source Map Diff Apply CB");
} }
void checkDiffSelection(AddressSetView addrSet) { void checkDiffSelection(AddressSetView addrSet) {

View file

@ -136,6 +136,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
isReplace(functionApplyCB); isReplace(functionApplyCB);
isReplace(bookmarkApplyCB); isReplace(bookmarkApplyCB);
isReplace(propertiesApplyCB); isReplace(propertiesApplyCB);
isIgnore(sourceMapApplyCB);
// Change the apply settings. // Change the apply settings.
ignore(programContextApplyCB); ignore(programContextApplyCB);
@ -151,6 +152,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
ignore(functionApplyCB); ignore(functionApplyCB);
ignore(bookmarkApplyCB); ignore(bookmarkApplyCB);
ignore(propertiesApplyCB); ignore(propertiesApplyCB);
replace(sourceMapApplyCB);
// Save the settings. // Save the settings.
DockingActionIf saveApplySettingsAction = DockingActionIf saveApplySettingsAction =
@ -172,6 +174,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
isIgnore(functionApplyCB); isIgnore(functionApplyCB);
isIgnore(bookmarkApplyCB); isIgnore(bookmarkApplyCB);
isIgnore(propertiesApplyCB); isIgnore(propertiesApplyCB);
isReplace(sourceMapApplyCB);
ProgramManagerPlugin pm = getPlugin(tool, ProgramManagerPlugin.class); ProgramManagerPlugin pm = getPlugin(tool, ProgramManagerPlugin.class);
DockingActionIf closeAllProgramAction = getAction(pm, "Close All"); DockingActionIf closeAllProgramAction = getAction(pm, "Close All");
@ -197,6 +200,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
isIgnore(functionApplyCB); isIgnore(functionApplyCB);
isIgnore(bookmarkApplyCB); isIgnore(bookmarkApplyCB);
isIgnore(propertiesApplyCB); isIgnore(propertiesApplyCB);
isReplace(sourceMapApplyCB);
DockingActionIf closeToolAction = getToolAction(tool, "Close Tool"); DockingActionIf closeToolAction = getToolAction(tool, "Close Tool");
performAction(closeToolAction, false); performAction(closeToolAction, false);
@ -226,6 +230,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
isIgnore(functionApplyCB); isIgnore(functionApplyCB);
isIgnore(bookmarkApplyCB); isIgnore(bookmarkApplyCB);
isIgnore(propertiesApplyCB); isIgnore(propertiesApplyCB);
isReplace(sourceMapApplyCB);
closeOurTool(); closeOurTool();
} }