mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-0 corrected additional diff apply failures
This commit is contained in:
parent
5a156112a0
commit
18b1d9e6c6
3 changed files with 18 additions and 4 deletions
|
@ -4,9 +4,9 @@
|
|||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -20,6 +20,7 @@ import ghidra.framework.plugintool.Plugin;
|
|||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.program.util.ProgramMergeFilter;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
|
||||
/**
|
||||
* Manages the options for the Diff apply settings.
|
||||
|
@ -396,6 +397,8 @@ class DiffApplySettingsOptionManager {
|
|||
return ProgramMergeFilter.SYMBOLS;
|
||||
case FUNCTION_TAGS:
|
||||
return ProgramMergeFilter.FUNCTION_TAGS;
|
||||
case SOURCE_MAP:
|
||||
return ProgramMergeFilter.SOURCE_MAP;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -436,6 +439,8 @@ class DiffApplySettingsOptionManager {
|
|||
return OPTION_SYMBOLS;
|
||||
case FUNCTION_TAGS:
|
||||
return OPTION_FUNCTION_TAGS;
|
||||
case SOURCE_MAP:
|
||||
return OPTION_SOURCE_MAP;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -520,6 +525,7 @@ class DiffApplySettingsOptionManager {
|
|||
private REPLACE_CHOICE convertTypeToReplaceEnum(ProgramMergeFilter defaultApplyFilter,
|
||||
int type) {
|
||||
int filter = defaultApplyFilter.getFilter(type);
|
||||
Msg.info(this, "type: " + Integer.toHexString(filter) + " filter: " + filter);
|
||||
return REPLACE_CHOICE.values()[filter];
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ public class DiffApplyTestAdapter extends DiffTestAdapter {
|
|||
JComboBox<?> bookmarkApplyCB;
|
||||
JComboBox<?> propertiesApplyCB;
|
||||
JComboBox<?> functionTagApplyCB;
|
||||
JComboBox<?> sourceMapApplyCB;
|
||||
|
||||
public DiffApplyTestAdapter() {
|
||||
super();
|
||||
|
@ -222,6 +223,8 @@ public class DiffApplyTestAdapter extends DiffTestAdapter {
|
|||
(JComboBox<?>) findComponentByName(settingsPanel, "Properties Diff Apply CB");
|
||||
functionTagApplyCB =
|
||||
(JComboBox<?>) findComponentByName(settingsPanel, "Function Tags Diff Apply CB");
|
||||
sourceMapApplyCB =
|
||||
(JComboBox<?>) findComponentByName(settingsPanel, "Source Map Diff Apply CB");
|
||||
}
|
||||
|
||||
void checkDiffSelection(AddressSetView addrSet) {
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -136,6 +136,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
|
|||
isReplace(functionApplyCB);
|
||||
isReplace(bookmarkApplyCB);
|
||||
isReplace(propertiesApplyCB);
|
||||
isIgnore(sourceMapApplyCB);
|
||||
|
||||
// Change the apply settings.
|
||||
ignore(programContextApplyCB);
|
||||
|
@ -151,6 +152,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
|
|||
ignore(functionApplyCB);
|
||||
ignore(bookmarkApplyCB);
|
||||
ignore(propertiesApplyCB);
|
||||
replace(sourceMapApplyCB);
|
||||
|
||||
// Save the settings.
|
||||
DockingActionIf saveApplySettingsAction =
|
||||
|
@ -172,6 +174,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
|
|||
isIgnore(functionApplyCB);
|
||||
isIgnore(bookmarkApplyCB);
|
||||
isIgnore(propertiesApplyCB);
|
||||
isReplace(sourceMapApplyCB);
|
||||
|
||||
ProgramManagerPlugin pm = getPlugin(tool, ProgramManagerPlugin.class);
|
||||
DockingActionIf closeAllProgramAction = getAction(pm, "Close All");
|
||||
|
@ -197,6 +200,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
|
|||
isIgnore(functionApplyCB);
|
||||
isIgnore(bookmarkApplyCB);
|
||||
isIgnore(propertiesApplyCB);
|
||||
isReplace(sourceMapApplyCB);
|
||||
|
||||
DockingActionIf closeToolAction = getToolAction(tool, "Close Tool");
|
||||
performAction(closeToolAction, false);
|
||||
|
@ -226,6 +230,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
|
|||
isIgnore(functionApplyCB);
|
||||
isIgnore(bookmarkApplyCB);
|
||||
isIgnore(propertiesApplyCB);
|
||||
isReplace(sourceMapApplyCB);
|
||||
|
||||
closeOurTool();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue