Package ghidra.app.merge.listing
Class ExternalFunctionMerger
- java.lang.Object
-
- ghidra.app.merge.listing.ExternalFunctionMerger
-
- All Implemented Interfaces:
ListingMergeConstants
public class ExternalFunctionMerger extends java.lang.Object
Class for merging external function and label changes. This class can merge external function and label changes that were made to the checked out version. It can determine where there are conflicts between the latest checked in version and my checked out version. It can then allow the user to manually merge the conflicting functions and labels. External functions do not have bodies. However their signatures, stacks and variables do get merged. This class extends the AbstractFunctionMerger to handle merging of function changes when both My and Latest have changed functions.
Note: Externals are uniquely identified by symbol ID and the name (including namespace is also used to match externals when the external is transitioned from a label to a function and vice versa.
Important: This class is intended to be used only for a single program version merge. It should be constructed, followed by an autoMerge(), and lastly each external with a conflict should have mergeConflicts() called on it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ExternalFunctionMerger.ExternalConflictType
-
Field Summary
Fields Modifier and Type Field Description protected static int
ALL_EXTERNAL_DIFFERENCES
protected static int
BODY_CONFLICT_SIZE
protected static int
BODY_CONFLICT_START
protected int
bodyChoice
protected int
changeNum
protected ConflictPanel
currentConflictPanel
protected TaskMonitor
currentMonitor
protected static int
DETAILS_CONFLICT_SIZE
protected static int
DETAILS_CONFLICT_START
protected int
detailsChoice
protected java.lang.StringBuffer
errorBuf
protected static int
EXTERNAL_ADDRESS
protected static int
EXTERNAL_DATA_TYPE
protected static int
EXTERNAL_FUNCTION
protected static int
EXTERNAL_LABEL
protected static int
EXTERNAL_NAMESPACE
protected static int
EXTERNAL_SYMBOL_TYPE
protected int
externalAddChoice
protected LongLongHashtable
externalAddConflicts
protected int
externalDataTypeChoice
protected AddressSet
externalDataTypeConflicts
protected ObjectIntHashtable<Address>
externalDetailConflicts
protected int
externalDetailsChoice
protected int
externalFunctionChoice
protected int
externalFunctionRemovalChoice
protected AddressSet
externalFunctionVersusDataTypeConflicts
protected int
externalFunctionVsDataTypeChoice
protected int
externalRemoveChoice
protected static int
FUNC_BODY
protected static int
FUNC_CALLING_CONVENTION
protected static int
FUNC_DETAIL_MASK
protected static int
FUNC_INLINE
protected static int
FUNC_LOCAL_DETAILS
protected static int
FUNC_NAME
protected static int
FUNC_NO_RETURN
protected static int
FUNC_OVERLAP
protected static int
FUNC_PARAM_DETAILS
protected static int
FUNC_REMOVE
protected static int
FUNC_RETURN
protected static int
FUNC_RETURN_ADDRESS_OFFSET
protected static int
FUNC_SIGNATURE
protected static int
FUNC_SIGNATURE_SOURCE
protected static int
FUNC_STACK_PURGE_SIZE
protected static int
FUNC_THUNK
protected static int
FUNC_VAR_STORAGE
protected ObjectIntHashtable<Address>
funcConflicts
protected AddressSet
funcSet
protected static int
FUNCTION_CONFLICT_SIZE
protected static int
FUNCTION_CONFLICT_START
protected FunctionManager[]
functionManagers
protected int
functionReturnChoice
protected static int
HEADER
protected static int
HIGHEST_DETAIL_BIT_SHIFT
protected java.lang.StringBuffer
infoBuf
static int
KEEP_BOTH_ADDS
Keep both of the external locations added in the LATEST and in MY when in conflict.static java.lang.String
KEEP_BOTH_BUTTON_NAME
static int
KEEP_LATEST_ADD
Keep the external location added in LATEST to resolve a conflict.static int
KEEP_MY_ADD
Keep the external location added in MY to resolve a conflict.protected static int
LATEST
protected static int
LATEST_VAR
protected LongObjectHashtable<DataType>
latestResolvedDts
protected ListingMergeManager
listingMergeManager
protected ListingMergePanel
listingMergePanel
protected int
localVariableDetailChoice
static int
MERGE_BOTH_ADDS
Merge both of the external locations added in the LATEST and in MY when in conflict.static java.lang.String
MERGE_BOTH_BUTTON_NAME
protected ProgramMultiUserMergeManager
mergeManager
protected static int
MY
protected static int
MY_VAR
protected LongObjectHashtable<DataType>
myResolvedDts
protected static int
ORIGINAL
protected static int
ORIGINAL_VAR
protected LongObjectHashtable<DataType>
origResolvedDts
protected int
overlapChoice
protected int
parameterInfoChoice
protected int
parameterSignatureChoice
protected Program[]
programs
protected int
removeChoice
protected int
removedLocalVariableChoice
protected static int
RESULT
protected AddressFactory
resultAddressFactory
protected ScrollingListChoicesPanel
scrollingListConflictPanel
protected static java.lang.String[]
STORAGE_CONFLICT_CHOICES
protected static java.lang.String[]
STORAGE_CONFLICT_HEADINGS
protected int
thunkChoice
protected int
totalChanges
protected static int
VAR_COMMENT
protected static int
VAR_DATATYPE
protected static int
VAR_NAME
protected static int
VAR_REMOVED
protected int
variableStorageChoice
protected VariousChoicesPanel
variousConflictPanel
protected VerticalChoicesPanel
verticalConflictPanel
-
Fields inherited from interface ghidra.app.merge.listing.ListingMergeConstants
ASK_USER, CANCELED, CHECKED_OUT_BUTTON_NAME, CHECKED_OUT_CHECK_BOX_NAME, CHECKED_OUT_LABEL_NAME, CHECKED_OUT_LIST_BUTTON_NAME, INFO_ROW, KEEP_ALL, KEEP_BOTH, KEEP_LATEST, KEEP_MY, KEEP_ORIGINAL, KEEP_RESULT, LATEST_BUTTON_NAME, LATEST_CHECK_BOX_NAME, LATEST_LABEL_NAME, LATEST_LIST_BUTTON_NAME, LATEST_TITLE, MY_TITLE, ORIGINAL_BUTTON_NAME, ORIGINAL_CHECK_BOX_NAME, ORIGINAL_LABEL_NAME, ORIGINAL_TITLE, REMOVE_CHECKED_OUT_BUTTON_NAME, REMOVE_LATEST, REMOVE_LATEST_BUTTON_NAME, REMOVE_MY, RENAME_CHECKED_OUT_BUTTON_NAME, RENAME_LATEST, RENAME_LATEST_BUTTON_NAME, RENAME_MY, RESULT_BUTTON_NAME, RESULT_TITLE, TRUNCATE_LENGTH
-
-
Constructor Summary
Constructors Constructor Description ExternalFunctionMerger(ListingMergeManager listingMergeManager, boolean showListingPanel)
Manages changes and conflicts for externals between the latest versioned program and the modified program being checked into version control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allChoicesAreResolved()
boolean
apply()
void
autoMerge(int progressMin, int progressMax, TaskMonitor monitor)
void
cancel()
protected void
clearConflictPanel()
protected int
countSetBits(int bits)
protected VariousChoicesPanel
createFunctionConflictPanel(Function[] functions, TaskMonitor monitor)
protected VerticalChoicesPanel
createFunctionReturnConflictPanel(Function[] functions, TaskMonitor monitor)
protected VariousChoicesPanel
createLocalVariableConflictPanel(ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict lvc, TaskMonitor monitor)
protected VerticalChoicesPanel
createParameterSigConflictPanel(Function[] functions, TaskMonitor monitor)
protected VariousChoicesPanel
createParamInfoConflictPanel(Function[] functions, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, TaskMonitor monitor)
protected VerticalChoicesPanel
createRemoveConflictPanel(Function[] functions, TaskMonitor monitor)
protected VerticalChoicesPanel
createRemovedVarConflictPanel(ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict lvc, TaskMonitor monitor)
Creates the panel for resolving a conflict due to a variable being removed.protected ScrollingListChoicesPanel
createStorageConflictPanel(Address entryPt, Pair<java.util.List<Variable>,java.util.List<Variable>> pair, TaskMonitor monitor)
protected java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict>
determineParameterInfoConflicts(Function[] functions, boolean autoMerge, TaskMonitor monitor)
protected boolean
determineReturnConflict(Function[] functions, boolean autoMerge, TaskMonitor monitor)
protected ghidra.app.merge.listing.FunctionVariableStorageConflicts
determineStorageConflict(Function[] functions, TaskMonitor monitor)
void
dispose()
int
getConflictCount(Address addr)
AddressSetView
getConflicts()
java.lang.String
getConflictType()
java.lang.String
getDescription()
protected ScrollingListChoicesPanel
getEmptyScrollingListChoicesPanel()
protected VariousChoicesPanel
getEmptyVariousPanel()
protected VerticalChoicesPanel
getEmptyVerticalPanel()
protected java.lang.String
getErrorTitle()
protected java.lang.String
getFunctionPrompt(Address addr, Function function, java.lang.String version)
protected java.lang.String
getInfoTitle()
java.lang.String
getName()
int
getNumConflictsResolved()
protected java.lang.String[]
getReturnInfo(Program pgm, java.lang.String returnStr, java.lang.String prefix, java.lang.String suffix)
protected java.lang.String
getReturnString(Function func, boolean includeStorage)
protected java.lang.String[]
getSignatureInfo(Program pgm, Function f, java.lang.String prefix, java.lang.String suffix)
protected java.util.List<java.lang.String[]>
getVariableDetails(java.util.List<Variable> list)
boolean
hasConflict(Address addr)
void
init()
protected void
initializeAutoMerge(java.lang.String progressMessage, int progressMin, int progressMax, TaskMonitor monitor)
protected void
mergeBasicExternalDetail(int type, ExternalLocation[] externalLocations, int currentChosenOption, TaskMonitor monitor)
void
mergeConflicts(int chosenConflictOption, ConflictInfoPanel listingConflictInfoPanel, TaskMonitor monitor)
Performs a manual merge of external program conflicts.void
mergeConflicts(ListingMergePanel listingPanel, Address addr, int conflictOption, TaskMonitor monitor)
void
mergeConflictsForAdd(ExternalLocation[] externalLocations, int chosenConflictOption, TaskMonitor monitor)
void
mergeFunction(ExternalLocation[] externalLocations, int currentChosenOption, TaskMonitor monitor)
protected void
mergeFunctionDetail(int type, Address entry, ProgramMerge pgmMerge, TaskMonitor monitor)
protected void
mergeLocal(Address entryPt, ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict localVarConflict, int chosenConflictOption, TaskMonitor monitor)
protected void
mergeLocals(Address entryPt, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict> localVarConflicts, int chosenConflictOption, TaskMonitor monitor)
protected void
mergeParameter(int type, Address entry, int ordinal, int currentConflictOption, TaskMonitor monitor)
protected void
mergeParameter(int type, Function[] functions, int ordinal, int currentConflictOption, TaskMonitor monitor)
protected void
mergeParameters(Function[] functions, int chosenConflictOption, TaskMonitor monitor)
protected void
mergeParamInfo(Address entryPt, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, int chosenConflictOption, TaskMonitor monitor)
protected void
mergeParamInfo(Address entryPt, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict> paramInfoConflicts, int chosenConflictOption, TaskMonitor monitor)
protected void
mergeParamInfo(Function[] functions, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, int chosenConflictOption, TaskMonitor monitor)
protected void
mergeParamInfo(Function[] functions, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict> paramInfoConflicts, int chosenConflictOption, TaskMonitor monitor)
protected void
mergeVariableStorage(Address entryPt, Pair<java.util.List<Variable>,java.util.List<Variable>> pair, int currentConflictOption, TaskMonitor monitor)
void
refreshResultPanel(ExternalLocation[] externalLocations)
void
replaceExternalDataType(ExternalLocation resultExternalLocation, ExternalLocation fromExternalLocation, TaskMonitor monitor)
replaceExternalDataType
replaces the data type of the external label in program1 with the data type of the external label in program2 at the specified external space address.ExternalLocation
replaceExternalLocation(ExternalLocation toExternalLocation, ExternalLocation fromExternalLocation, ProgramMerge programMerge, TaskMonitor monitor)
protected void
runSwing(java.lang.Runnable r)
protected void
saveFunctionDetailConflict(Function[] functions, int type)
Saves information indicating there is a conflict that needs to be resolved for a particular part of a function as indicated by the type.protected void
updateProgressMessage(java.lang.String message)
Updates the progress message details associated with this phase of the merge.
-
-
-
Field Detail
-
EXTERNAL_NAMESPACE
protected static final int EXTERNAL_NAMESPACE
- See Also:
- Constant Field Values
-
EXTERNAL_LABEL
protected static final int EXTERNAL_LABEL
- See Also:
- Constant Field Values
-
EXTERNAL_ADDRESS
protected static final int EXTERNAL_ADDRESS
- See Also:
- Constant Field Values
-
EXTERNAL_SYMBOL_TYPE
protected static final int EXTERNAL_SYMBOL_TYPE
- See Also:
- Constant Field Values
-
EXTERNAL_DATA_TYPE
protected static final int EXTERNAL_DATA_TYPE
- See Also:
- Constant Field Values
-
EXTERNAL_FUNCTION
protected static final int EXTERNAL_FUNCTION
- See Also:
- Constant Field Values
-
HIGHEST_DETAIL_BIT_SHIFT
protected static final int HIGHEST_DETAIL_BIT_SHIFT
- See Also:
- Constant Field Values
-
ALL_EXTERNAL_DIFFERENCES
protected static final int ALL_EXTERNAL_DIFFERENCES
- See Also:
- Constant Field Values
-
KEEP_LATEST_ADD
public static final int KEEP_LATEST_ADD
Keep the external location added in LATEST to resolve a conflict.- See Also:
- Constant Field Values
-
KEEP_MY_ADD
public static final int KEEP_MY_ADD
Keep the external location added in MY to resolve a conflict.- See Also:
- Constant Field Values
-
KEEP_BOTH_ADDS
public static final int KEEP_BOTH_ADDS
Keep both of the external locations added in the LATEST and in MY when in conflict.- See Also:
- Constant Field Values
-
MERGE_BOTH_ADDS
public static final int MERGE_BOTH_ADDS
Merge both of the external locations added in the LATEST and in MY when in conflict.- See Also:
- Constant Field Values
-
KEEP_BOTH_BUTTON_NAME
public static final java.lang.String KEEP_BOTH_BUTTON_NAME
- See Also:
- Constant Field Values
-
MERGE_BOTH_BUTTON_NAME
public static final java.lang.String MERGE_BOTH_BUTTON_NAME
- See Also:
- Constant Field Values
-
externalDetailConflicts
protected ObjectIntHashtable<Address> externalDetailConflicts
-
externalDataTypeConflicts
protected AddressSet externalDataTypeConflicts
-
externalFunctionVersusDataTypeConflicts
protected AddressSet externalFunctionVersusDataTypeConflicts
-
externalAddConflicts
protected LongLongHashtable externalAddConflicts
-
totalChanges
protected int totalChanges
-
changeNum
protected int changeNum
-
externalFunctionRemovalChoice
protected int externalFunctionRemovalChoice
-
externalFunctionChoice
protected int externalFunctionChoice
-
externalDetailsChoice
protected int externalDetailsChoice
-
externalDataTypeChoice
protected int externalDataTypeChoice
-
externalFunctionVsDataTypeChoice
protected int externalFunctionVsDataTypeChoice
-
externalAddChoice
protected int externalAddChoice
-
externalRemoveChoice
protected int externalRemoveChoice
-
BODY_CONFLICT_START
protected static final int BODY_CONFLICT_START
- See Also:
- Constant Field Values
-
BODY_CONFLICT_SIZE
protected static final int BODY_CONFLICT_SIZE
- See Also:
- Constant Field Values
-
FUNCTION_CONFLICT_START
protected static final int FUNCTION_CONFLICT_START
- See Also:
- Constant Field Values
-
FUNCTION_CONFLICT_SIZE
protected static final int FUNCTION_CONFLICT_SIZE
- See Also:
- Constant Field Values
-
DETAILS_CONFLICT_START
protected static final int DETAILS_CONFLICT_START
- See Also:
- Constant Field Values
-
DETAILS_CONFLICT_SIZE
protected static final int DETAILS_CONFLICT_SIZE
- See Also:
- Constant Field Values
-
FUNC_OVERLAP
protected static final int FUNC_OVERLAP
- See Also:
- Constant Field Values
-
FUNC_BODY
protected static final int FUNC_BODY
- See Also:
- Constant Field Values
-
FUNC_REMOVE
protected static final int FUNC_REMOVE
- See Also:
- Constant Field Values
-
FUNC_THUNK
protected static final int FUNC_THUNK
- See Also:
- Constant Field Values
-
FUNC_RETURN
protected static final int FUNC_RETURN
- See Also:
- Constant Field Values
-
FUNC_RETURN_ADDRESS_OFFSET
protected static final int FUNC_RETURN_ADDRESS_OFFSET
- See Also:
- Constant Field Values
-
FUNC_STACK_PURGE_SIZE
protected static final int FUNC_STACK_PURGE_SIZE
- See Also:
- Constant Field Values
-
FUNC_NAME
protected static final int FUNC_NAME
- See Also:
- Constant Field Values
-
FUNC_INLINE
protected static final int FUNC_INLINE
- See Also:
- Constant Field Values
-
FUNC_NO_RETURN
protected static final int FUNC_NO_RETURN
- See Also:
- Constant Field Values
-
FUNC_CALLING_CONVENTION
protected static final int FUNC_CALLING_CONVENTION
- See Also:
- Constant Field Values
-
FUNC_VAR_STORAGE
protected static final int FUNC_VAR_STORAGE
- See Also:
- Constant Field Values
-
FUNC_SIGNATURE
protected static final int FUNC_SIGNATURE
- See Also:
- Constant Field Values
-
FUNC_LOCAL_DETAILS
protected static final int FUNC_LOCAL_DETAILS
- See Also:
- Constant Field Values
-
FUNC_PARAM_DETAILS
protected static final int FUNC_PARAM_DETAILS
- See Also:
- Constant Field Values
-
FUNC_SIGNATURE_SOURCE
protected static final int FUNC_SIGNATURE_SOURCE
- See Also:
- Constant Field Values
-
FUNC_DETAIL_MASK
protected static final int FUNC_DETAIL_MASK
- See Also:
- Constant Field Values
-
VAR_NAME
protected static final int VAR_NAME
- See Also:
- Constant Field Values
-
VAR_DATATYPE
protected static final int VAR_DATATYPE
- See Also:
- Constant Field Values
-
VAR_COMMENT
protected static final int VAR_COMMENT
- See Also:
- Constant Field Values
-
VAR_REMOVED
protected static final int VAR_REMOVED
- See Also:
- Constant Field Values
-
HEADER
protected static final int HEADER
- See Also:
- Constant Field Values
-
RESULT
protected static final int RESULT
- See Also:
- Constant Field Values
-
LATEST
protected static final int LATEST
- See Also:
- Constant Field Values
-
MY
protected static final int MY
- See Also:
- Constant Field Values
-
ORIGINAL
protected static final int ORIGINAL
- See Also:
- Constant Field Values
-
ORIGINAL_VAR
protected static final int ORIGINAL_VAR
- See Also:
- Constant Field Values
-
LATEST_VAR
protected static final int LATEST_VAR
- See Also:
- Constant Field Values
-
MY_VAR
protected static final int MY_VAR
- See Also:
- Constant Field Values
-
errorBuf
protected java.lang.StringBuffer errorBuf
-
infoBuf
protected java.lang.StringBuffer infoBuf
-
mergeManager
protected ProgramMultiUserMergeManager mergeManager
-
programs
protected Program[] programs
-
functionManagers
protected FunctionManager[] functionManagers
-
listingMergeManager
protected ListingMergeManager listingMergeManager
-
resultAddressFactory
protected AddressFactory resultAddressFactory
-
latestResolvedDts
protected LongObjectHashtable<DataType> latestResolvedDts
-
myResolvedDts
protected LongObjectHashtable<DataType> myResolvedDts
-
origResolvedDts
protected LongObjectHashtable<DataType> origResolvedDts
-
listingMergePanel
protected ListingMergePanel listingMergePanel
-
verticalConflictPanel
protected VerticalChoicesPanel verticalConflictPanel
-
variousConflictPanel
protected VariousChoicesPanel variousConflictPanel
-
scrollingListConflictPanel
protected ScrollingListChoicesPanel scrollingListConflictPanel
-
currentConflictPanel
protected ConflictPanel currentConflictPanel
-
currentMonitor
protected TaskMonitor currentMonitor
-
overlapChoice
protected int overlapChoice
-
bodyChoice
protected int bodyChoice
-
functionReturnChoice
protected int functionReturnChoice
-
removeChoice
protected int removeChoice
-
detailsChoice
protected int detailsChoice
-
variableStorageChoice
protected int variableStorageChoice
-
parameterSignatureChoice
protected int parameterSignatureChoice
-
parameterInfoChoice
protected int parameterInfoChoice
-
removedLocalVariableChoice
protected int removedLocalVariableChoice
-
localVariableDetailChoice
protected int localVariableDetailChoice
-
thunkChoice
protected int thunkChoice
-
funcConflicts
protected ObjectIntHashtable<Address> funcConflicts
-
funcSet
protected AddressSet funcSet
-
STORAGE_CONFLICT_CHOICES
protected static final java.lang.String[] STORAGE_CONFLICT_CHOICES
-
STORAGE_CONFLICT_HEADINGS
protected static final java.lang.String[] STORAGE_CONFLICT_HEADINGS
-
-
Constructor Detail
-
ExternalFunctionMerger
public ExternalFunctionMerger(ListingMergeManager listingMergeManager, boolean showListingPanel)
Manages changes and conflicts for externals between the latest versioned program and the modified program being checked into version control.- Parameters:
mergeManager
- the top level merge manager for merging a program version.resultPgm
- the program to be updated with the result of the merge. This is the program that will actually get checked in.originalPgm
- the program that was checked out.latestPgm
- the latest checked-in version of the program.myPgm
- the program requesting to be checked in.latestChanges
- the address set of changes between original and latest versioned program.myChanges
- the address set of changes between original and my modified program.
-
-
Method Detail
-
init
public void init()
-
getName
public java.lang.String getName()
-
getDescription
public java.lang.String getDescription()
-
allChoicesAreResolved
public boolean allChoicesAreResolved()
-
apply
public boolean apply()
-
cancel
public void cancel()
-
autoMerge
public void autoMerge(int progressMin, int progressMax, TaskMonitor monitor) throws ProgramConflictException, MemoryAccessException, CancelledException
-
initializeAutoMerge
protected void initializeAutoMerge(java.lang.String progressMessage, int progressMin, int progressMax, TaskMonitor monitor)
-
replaceExternalDataType
public void replaceExternalDataType(ExternalLocation resultExternalLocation, ExternalLocation fromExternalLocation, TaskMonitor monitor) throws CancelledException
replaceExternalDataType
replaces the data type of the external label in program1 with the data type of the external label in program2 at the specified external space address.- Parameters:
resultExternalLocation
-fromExternalLocation
-monitor
- the task monitor for notifying the user of this merge's progress.- Throws:
CancelledException
-
mergeConflicts
public void mergeConflicts(int chosenConflictOption, ConflictInfoPanel listingConflictInfoPanel, TaskMonitor monitor) throws CancelledException
Performs a manual merge of external program conflicts.- Parameters:
chosenConflictOption
- ASK_USER means interactively resolve conflicts. JUnit testing also allows setting this to LATEST, MY, or ORIGINAL to force selection of a particular version change.monitor
- task monitor for informing the user of progress.- Throws:
CancelledException
- if the user cancels the merge.
-
mergeConflictsForAdd
public void mergeConflictsForAdd(ExternalLocation[] externalLocations, int chosenConflictOption, TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
createParamInfoConflictPanel
protected VariousChoicesPanel createParamInfoConflictPanel(Function[] functions, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, TaskMonitor monitor)
-
replaceExternalLocation
public ExternalLocation replaceExternalLocation(ExternalLocation toExternalLocation, ExternalLocation fromExternalLocation, ProgramMerge programMerge, TaskMonitor monitor) throws DuplicateNameException, InvalidInputException, CancelledException
-
mergeBasicExternalDetail
protected void mergeBasicExternalDetail(int type, ExternalLocation[] externalLocations, int currentChosenOption, TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
mergeFunction
public void mergeFunction(ExternalLocation[] externalLocations, int currentChosenOption, TaskMonitor monitor) throws CancelledException, java.lang.UnsupportedOperationException
- Throws:
CancelledException
java.lang.UnsupportedOperationException
-
refreshResultPanel
public void refreshResultPanel(ExternalLocation[] externalLocations)
-
saveFunctionDetailConflict
protected void saveFunctionDetailConflict(Function[] functions, int type)
Saves information indicating there is a conflict that needs to be resolved for a particular part of a function as indicated by the type.- Parameters:
functions
- the matching set of functions from Result, Latest, My, and Original (Some may be null) which have the detailed type of conflict.type
- function conflict flags to be set (FUNC_RETURN_TYPE, FUNC_RETURN_ADDRESS_OFFSET, FUNC_STACK_PURGE_SIZE, FUNC_NAME FUNC_INLINE, FUNC_NO_RETURN, FUNC_CALLING_CONVENTION, FUNC_VAR_STORAGE FUNC_CUSTOM_STORAGE, FUNC_VAR_DETAILS, FUNC_SIGNATURE)
-
getConflictType
public java.lang.String getConflictType()
-
getNumConflictsResolved
public int getNumConflictsResolved()
-
hasConflict
public boolean hasConflict(Address addr)
-
getConflictCount
public int getConflictCount(Address addr)
-
mergeConflicts
public void mergeConflicts(ListingMergePanel listingPanel, Address addr, int conflictOption, TaskMonitor monitor) throws CancelledException, MemoryAccessException
-
getConflicts
public AddressSetView getConflicts()
-
getInfoTitle
protected java.lang.String getInfoTitle()
-
getErrorTitle
protected java.lang.String getErrorTitle()
-
dispose
public void dispose()
-
determineStorageConflict
protected ghidra.app.merge.listing.FunctionVariableStorageConflicts determineStorageConflict(Function[] functions, TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
determineReturnConflict
protected boolean determineReturnConflict(Function[] functions, boolean autoMerge, TaskMonitor monitor)
-
determineParameterInfoConflicts
protected java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict> determineParameterInfoConflicts(Function[] functions, boolean autoMerge, TaskMonitor monitor)
-
mergeParameter
protected void mergeParameter(int type, Address entry, int ordinal, int currentConflictOption, TaskMonitor monitor)
-
mergeParameter
protected void mergeParameter(int type, Function[] functions, int ordinal, int currentConflictOption, TaskMonitor monitor)
-
countSetBits
protected int countSetBits(int bits)
-
mergeFunctionDetail
protected void mergeFunctionDetail(int type, Address entry, ProgramMerge pgmMerge, TaskMonitor monitor)
-
mergeParameters
protected void mergeParameters(Function[] functions, int chosenConflictOption, TaskMonitor monitor)
-
mergeParamInfo
protected void mergeParamInfo(Address entryPt, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict> paramInfoConflicts, int chosenConflictOption, TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
mergeParamInfo
protected void mergeParamInfo(Address entryPt, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, int chosenConflictOption, TaskMonitor monitor)
-
mergeParamInfo
protected void mergeParamInfo(Function[] functions, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict> paramInfoConflicts, int chosenConflictOption, TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
mergeParamInfo
protected void mergeParamInfo(Function[] functions, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, int chosenConflictOption, TaskMonitor monitor)
-
mergeLocals
protected void mergeLocals(Address entryPt, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict> localVarConflicts, int chosenConflictOption, TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
mergeLocal
protected void mergeLocal(Address entryPt, ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict localVarConflict, int chosenConflictOption, TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
getEmptyVerticalPanel
protected VerticalChoicesPanel getEmptyVerticalPanel()
-
getEmptyScrollingListChoicesPanel
protected ScrollingListChoicesPanel getEmptyScrollingListChoicesPanel()
-
getEmptyVariousPanel
protected VariousChoicesPanel getEmptyVariousPanel()
-
getReturnString
protected java.lang.String getReturnString(Function func, boolean includeStorage)
-
getReturnInfo
protected java.lang.String[] getReturnInfo(Program pgm, java.lang.String returnStr, java.lang.String prefix, java.lang.String suffix)
-
getSignatureInfo
protected java.lang.String[] getSignatureInfo(Program pgm, Function f, java.lang.String prefix, java.lang.String suffix)
-
clearConflictPanel
protected void clearConflictPanel()
-
runSwing
protected void runSwing(java.lang.Runnable r)
-
createLocalVariableConflictPanel
protected VariousChoicesPanel createLocalVariableConflictPanel(ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict lvc, TaskMonitor monitor)
-
createRemoveConflictPanel
protected VerticalChoicesPanel createRemoveConflictPanel(Function[] functions, TaskMonitor monitor)
-
createStorageConflictPanel
protected ScrollingListChoicesPanel createStorageConflictPanel(Address entryPt, Pair<java.util.List<Variable>,java.util.List<Variable>> pair, TaskMonitor monitor)
-
mergeVariableStorage
protected void mergeVariableStorage(Address entryPt, Pair<java.util.List<Variable>,java.util.List<Variable>> pair, int currentConflictOption, TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
getVariableDetails
protected java.util.List<java.lang.String[]> getVariableDetails(java.util.List<Variable> list)
-
createParameterSigConflictPanel
protected VerticalChoicesPanel createParameterSigConflictPanel(Function[] functions, TaskMonitor monitor)
-
createFunctionConflictPanel
protected VariousChoicesPanel createFunctionConflictPanel(Function[] functions, TaskMonitor monitor)
-
createFunctionReturnConflictPanel
protected VerticalChoicesPanel createFunctionReturnConflictPanel(Function[] functions, TaskMonitor monitor)
-
createRemovedVarConflictPanel
protected VerticalChoicesPanel createRemovedVarConflictPanel(ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict lvc, TaskMonitor monitor)
Creates the panel for resolving a conflict due to a variable being removed.- Parameters:
entryPt
- the function entry point for the function variables.vars
- variables from the different programs [0]=Original, [1]=Latest, [2]=Mymonitor
- status monitor- Returns:
- the panel
-
getFunctionPrompt
protected java.lang.String getFunctionPrompt(Address addr, Function function, java.lang.String version)
-
updateProgressMessage
protected void updateProgressMessage(java.lang.String message)
Updates the progress message details associated with this phase of the merge.- Parameters:
progressMessage
- a message indicating what is currently occurring in this phase. Null indicates to use the default message.
-
-