Class ExternalFunctionMerger

java.lang.Object
ghidra.app.merge.listing.ExternalFunctionMerger
All Implemented Interfaces:
ListingMergeConstants

public class ExternalFunctionMerger extends 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.
  • Field Details

    • EXTERNAL_NAMESPACE

      protected static final int EXTERNAL_NAMESPACE
      See Also:
    • EXTERNAL_LABEL

      protected static final int EXTERNAL_LABEL
      See Also:
    • EXTERNAL_ADDRESS

      protected static final int EXTERNAL_ADDRESS
      See Also:
    • EXTERNAL_SYMBOL_TYPE

      protected static final int EXTERNAL_SYMBOL_TYPE
      See Also:
    • EXTERNAL_DATA_TYPE

      protected static final int EXTERNAL_DATA_TYPE
      See Also:
    • EXTERNAL_FUNCTION

      protected static final int EXTERNAL_FUNCTION
      See Also:
    • HIGHEST_DETAIL_BIT_SHIFT

      protected static final int HIGHEST_DETAIL_BIT_SHIFT
      See Also:
    • ALL_EXTERNAL_DIFFERENCES

      protected static final int ALL_EXTERNAL_DIFFERENCES
      See Also:
    • KEEP_LATEST_ADD

      public static final int KEEP_LATEST_ADD
      Keep the external location added in LATEST to resolve a conflict.
      See Also:
    • KEEP_MY_ADD

      public static final int KEEP_MY_ADD
      Keep the external location added in MY to resolve a conflict.
      See Also:
    • 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:
    • 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:
    • KEEP_BOTH_BUTTON_NAME

      public static final String KEEP_BOTH_BUTTON_NAME
      See Also:
    • MERGE_BOTH_BUTTON_NAME

      public static final String MERGE_BOTH_BUTTON_NAME
      See Also:
    • 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:
    • BODY_CONFLICT_SIZE

      protected static final int BODY_CONFLICT_SIZE
      See Also:
    • FUNCTION_CONFLICT_START

      protected static final int FUNCTION_CONFLICT_START
      See Also:
    • FUNCTION_CONFLICT_SIZE

      protected static final int FUNCTION_CONFLICT_SIZE
      See Also:
    • DETAILS_CONFLICT_START

      protected static final int DETAILS_CONFLICT_START
      See Also:
    • DETAILS_CONFLICT_SIZE

      protected static final int DETAILS_CONFLICT_SIZE
      See Also:
    • FUNC_OVERLAP

      protected static final int FUNC_OVERLAP
      See Also:
    • FUNC_BODY

      protected static final int FUNC_BODY
      See Also:
    • FUNC_REMOVE

      protected static final int FUNC_REMOVE
      See Also:
    • FUNC_THUNK

      protected static final int FUNC_THUNK
      See Also:
    • FUNC_RETURN

      protected static final int FUNC_RETURN
      See Also:
    • FUNC_RETURN_ADDRESS_OFFSET

      protected static final int FUNC_RETURN_ADDRESS_OFFSET
      See Also:
    • FUNC_STACK_PURGE_SIZE

      protected static final int FUNC_STACK_PURGE_SIZE
      See Also:
    • FUNC_NAME

      protected static final int FUNC_NAME
      See Also:
    • FUNC_INLINE

      protected static final int FUNC_INLINE
      See Also:
    • FUNC_NO_RETURN

      protected static final int FUNC_NO_RETURN
      See Also:
    • FUNC_CALLING_CONVENTION

      protected static final int FUNC_CALLING_CONVENTION
      See Also:
    • FUNC_VAR_STORAGE

      protected static final int FUNC_VAR_STORAGE
      See Also:
    • FUNC_SIGNATURE

      protected static final int FUNC_SIGNATURE
      See Also:
    • FUNC_LOCAL_DETAILS

      protected static final int FUNC_LOCAL_DETAILS
      See Also:
    • FUNC_PARAM_DETAILS

      protected static final int FUNC_PARAM_DETAILS
      See Also:
    • FUNC_SIGNATURE_SOURCE

      protected static final int FUNC_SIGNATURE_SOURCE
      See Also:
    • FUNC_DETAIL_MASK

      protected static final int FUNC_DETAIL_MASK
      See Also:
    • VAR_NAME

      protected static final int VAR_NAME
      See Also:
    • VAR_DATATYPE

      protected static final int VAR_DATATYPE
      See Also:
    • VAR_COMMENT

      protected static final int VAR_COMMENT
      See Also:
    • VAR_REMOVED

      protected static final int VAR_REMOVED
      See Also:
    • RESULT

      protected static final int RESULT
      See Also:
    • LATEST

      protected static final int LATEST
      See Also:
    • MY

      protected static final int MY
      See Also:
    • ORIGINAL

      protected static final int ORIGINAL
      See Also:
    • ORIGINAL_VAR

      protected static final int ORIGINAL_VAR
      See Also:
    • LATEST_VAR

      protected static final int LATEST_VAR
      See Also:
    • MY_VAR

      protected static final int MY_VAR
      See Also:
    • errorBuf

      protected StringBuffer errorBuf
    • infoBuf

      protected StringBuffer infoBuf
    • mergeManager

      protected ProgramMultiUserMergeManager mergeManager
    • programs

      protected Program[] programs
    • functionManagers

      protected FunctionManager[] functionManagers
    • listingMergeManager

      protected ListingMergeManager listingMergeManager
    • resultAddressFactory

      protected AddressFactory resultAddressFactory
    • latestResolvedDts

      protected Map<Long,DataType> latestResolvedDts
    • myResolvedDts

      protected Map<Long,DataType> myResolvedDts
    • origResolvedDts

      protected Map<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 String[] STORAGE_CONFLICT_CHOICES
    • STORAGE_CONFLICT_HEADINGS

      protected static final String[] STORAGE_CONFLICT_HEADINGS
  • Constructor Details

    • 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 Details