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.ObjectClass 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 classExternalFunctionMerger.ExternalConflictType
-
Field Summary
Fields Modifier and Type Field Description protected static intALL_EXTERNAL_DIFFERENCESprotected static intBODY_CONFLICT_SIZEprotected static intBODY_CONFLICT_STARTprotected intbodyChoiceprotected intchangeNumprotected ConflictPanelcurrentConflictPanelprotected TaskMonitorcurrentMonitorprotected static intDETAILS_CONFLICT_SIZEprotected static intDETAILS_CONFLICT_STARTprotected intdetailsChoiceprotected java.lang.StringBuffererrorBufprotected static intEXTERNAL_ADDRESSprotected static intEXTERNAL_DATA_TYPEprotected static intEXTERNAL_FUNCTIONprotected static intEXTERNAL_LABELprotected static intEXTERNAL_NAMESPACEprotected static intEXTERNAL_SYMBOL_TYPEprotected intexternalAddChoiceprotected LongLongHashtableexternalAddConflictsprotected intexternalDataTypeChoiceprotected AddressSetexternalDataTypeConflictsprotected ObjectIntHashtable<Address>externalDetailConflictsprotected intexternalDetailsChoiceprotected intexternalFunctionChoiceprotected intexternalFunctionRemovalChoiceprotected AddressSetexternalFunctionVersusDataTypeConflictsprotected intexternalFunctionVsDataTypeChoiceprotected intexternalRemoveChoiceprotected static intFUNC_BODYprotected static intFUNC_CALLING_CONVENTIONprotected static intFUNC_DETAIL_MASKprotected static intFUNC_INLINEprotected static intFUNC_LOCAL_DETAILSprotected static intFUNC_NAMEprotected static intFUNC_NO_RETURNprotected static intFUNC_OVERLAPprotected static intFUNC_PARAM_DETAILSprotected static intFUNC_REMOVEprotected static intFUNC_RETURNprotected static intFUNC_RETURN_ADDRESS_OFFSETprotected static intFUNC_SIGNATUREprotected static intFUNC_SIGNATURE_SOURCEprotected static intFUNC_STACK_PURGE_SIZEprotected static intFUNC_THUNKprotected static intFUNC_VAR_STORAGEprotected ObjectIntHashtable<Address>funcConflictsprotected AddressSetfuncSetprotected static intFUNCTION_CONFLICT_SIZEprotected static intFUNCTION_CONFLICT_STARTprotected FunctionManager[]functionManagersprotected intfunctionReturnChoiceprotected static intHEADERprotected static intHIGHEST_DETAIL_BIT_SHIFTprotected java.lang.StringBufferinfoBufstatic intKEEP_BOTH_ADDSKeep both of the external locations added in the LATEST and in MY when in conflict.static java.lang.StringKEEP_BOTH_BUTTON_NAMEstatic intKEEP_LATEST_ADDKeep the external location added in LATEST to resolve a conflict.static intKEEP_MY_ADDKeep the external location added in MY to resolve a conflict.protected static intLATESTprotected static intLATEST_VARprotected java.util.Map<java.lang.Long,DataType>latestResolvedDtsprotected ListingMergeManagerlistingMergeManagerprotected ListingMergePanellistingMergePanelprotected intlocalVariableDetailChoicestatic intMERGE_BOTH_ADDSMerge both of the external locations added in the LATEST and in MY when in conflict.static java.lang.StringMERGE_BOTH_BUTTON_NAMEprotected ProgramMultiUserMergeManagermergeManagerprotected static intMYprotected static intMY_VARprotected java.util.Map<java.lang.Long,DataType>myResolvedDtsprotected static intORIGINALprotected static intORIGINAL_VARprotected java.util.Map<java.lang.Long,DataType>origResolvedDtsprotected intoverlapChoiceprotected intparameterInfoChoiceprotected intparameterSignatureChoiceprotected Program[]programsprotected intremoveChoiceprotected intremovedLocalVariableChoiceprotected static intRESULTprotected AddressFactoryresultAddressFactoryprotected ScrollingListChoicesPanelscrollingListConflictPanelprotected static java.lang.String[]STORAGE_CONFLICT_CHOICESprotected static java.lang.String[]STORAGE_CONFLICT_HEADINGSprotected intthunkChoiceprotected inttotalChangesprotected static intVAR_COMMENTprotected static intVAR_DATATYPEprotected static intVAR_NAMEprotected static intVAR_REMOVEDprotected intvariableStorageChoiceprotected VariousChoicesPanelvariousConflictPanelprotected VerticalChoicesPanelverticalConflictPanel-
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 booleanallChoicesAreResolved()booleanapply()voidautoMerge(int progressMin, int progressMax, TaskMonitor monitor)voidcancel()protected voidclearConflictPanel()protected intcountSetBits(int bits)protected VariousChoicesPanelcreateFunctionConflictPanel(Function[] functions, TaskMonitor monitor)protected VerticalChoicesPanelcreateFunctionReturnConflictPanel(Function[] functions, TaskMonitor monitor)protected VariousChoicesPanelcreateLocalVariableConflictPanel(ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict lvc, TaskMonitor monitor)protected VerticalChoicesPanelcreateParameterSigConflictPanel(Function[] functions, TaskMonitor monitor)protected VariousChoicesPanelcreateParamInfoConflictPanel(Function[] functions, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, TaskMonitor monitor)protected VerticalChoicesPanelcreateRemoveConflictPanel(Function[] functions, TaskMonitor monitor)protected VerticalChoicesPanelcreateRemovedVarConflictPanel(ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict lvc, TaskMonitor monitor)Creates the panel for resolving a conflict due to a variable being removed.protected ScrollingListChoicesPanelcreateStorageConflictPanel(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 booleandetermineReturnConflict(Function[] functions, boolean autoMerge, TaskMonitor monitor)protected ghidra.app.merge.listing.FunctionVariableStorageConflictsdetermineStorageConflict(Function[] functions, TaskMonitor monitor)voiddispose()intgetConflictCount(Address addr)AddressSetViewgetConflicts()java.lang.StringgetConflictType()java.lang.StringgetDescription()protected ScrollingListChoicesPanelgetEmptyScrollingListChoicesPanel()protected VariousChoicesPanelgetEmptyVariousPanel()protected VerticalChoicesPanelgetEmptyVerticalPanel()protected java.lang.StringgetErrorTitle()protected java.lang.StringgetFunctionPrompt(Address addr, Function function, java.lang.String version)protected java.lang.StringgetInfoTitle()java.lang.StringgetName()intgetNumConflictsResolved()protected java.lang.String[]getReturnInfo(Program pgm, java.lang.String returnStr, java.lang.String prefix, java.lang.String suffix)protected java.lang.StringgetReturnString(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)booleanhasConflict(Address addr)voidinit()protected voidinitializeAutoMerge(java.lang.String progressMessage, int progressMin, int progressMax, TaskMonitor monitor)protected voidmergeBasicExternalDetail(int type, ExternalLocation[] externalLocations, int currentChosenOption, TaskMonitor monitor)voidmergeConflicts(int chosenConflictOption, ConflictInfoPanel listingConflictInfoPanel, TaskMonitor monitor)Performs a manual merge of external program conflicts.voidmergeConflicts(ListingMergePanel listingPanel, Address addr, int conflictOption, TaskMonitor monitor)voidmergeConflictsForAdd(ExternalLocation[] externalLocations, int chosenConflictOption, TaskMonitor monitor)voidmergeFunction(ExternalLocation[] externalLocations, int currentChosenOption, TaskMonitor monitor)protected voidmergeFunctionDetail(int type, Address entry, ProgramMerge pgmMerge, TaskMonitor monitor)protected voidmergeLocal(Address entryPt, ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict localVarConflict, int chosenConflictOption, TaskMonitor monitor)protected voidmergeLocals(Address entryPt, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.LocalVariableConflict> localVarConflicts, int chosenConflictOption, TaskMonitor monitor)protected voidmergeParameter(int type, Address entry, int ordinal, int currentConflictOption, TaskMonitor monitor)protected voidmergeParameter(int type, Function[] functions, int ordinal, int currentConflictOption, TaskMonitor monitor)protected voidmergeParameters(Function[] functions, int chosenConflictOption, TaskMonitor monitor)protected voidmergeParamInfo(Address entryPt, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, int chosenConflictOption, TaskMonitor monitor)protected voidmergeParamInfo(Address entryPt, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict> paramInfoConflicts, int chosenConflictOption, TaskMonitor monitor)protected voidmergeParamInfo(Function[] functions, ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict pc, int chosenConflictOption, TaskMonitor monitor)protected voidmergeParamInfo(Function[] functions, java.util.List<ghidra.app.merge.listing.AbstractFunctionMerger.ParamInfoConflict> paramInfoConflicts, int chosenConflictOption, TaskMonitor monitor)protected voidmergeVariableStorage(Address entryPt, Pair<java.util.List<Variable>,java.util.List<Variable>> pair, int currentConflictOption, TaskMonitor monitor)voidrefreshResultPanel(ExternalLocation[] externalLocations)voidreplaceExternalDataType(ExternalLocation resultExternalLocation, ExternalLocation fromExternalLocation, TaskMonitor monitor)replaceExternalDataTypereplaces 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.ExternalLocationreplaceExternalLocation(ExternalLocation toExternalLocation, ExternalLocation fromExternalLocation, ProgramMerge programMerge, TaskMonitor monitor)protected voidrunSwing(java.lang.Runnable r)protected voidsaveFunctionDetailConflict(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 voidupdateProgressMessage(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 java.util.Map<java.lang.Long,DataType> latestResolvedDts
-
myResolvedDts
protected java.util.Map<java.lang.Long,DataType> myResolvedDts
-
origResolvedDts
protected java.util.Map<java.lang.Long,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:
listingMergeManager- the top level merge manager for merging a program version.showListingPanel- true to show the listing panel.
-
-
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
replaceExternalDataTypereplaces 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 CancelledExceptionPerforms 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:
CancelledExceptionjava.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:
lvc- the local variable conflictmonitor- 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:
message- a message indicating what is currently occurring in this phase. Null indicates to use the default message.
-
-