Class ExternalLocationDB

java.lang.Object
ghidra.program.database.external.ExternalLocationDB
All Implemented Interfaces:
ExternalLocation

public class ExternalLocationDB extends Object implements ExternalLocation
  • Method Details

    • getSymbol

      public Symbol getSymbol()
      Description copied from interface: ExternalLocation
      Returns the symbol associated with this external location or null.
      Specified by:
      getSymbol in interface ExternalLocation
      Returns:
      the symbol associated with this external location or null.
    • getLibraryName

      public String getLibraryName()
      Description copied from interface: ExternalLocation
      Returns the name of the external program containing this location.
      Specified by:
      getLibraryName in interface ExternalLocation
      Returns:
      the name of the external program containing this location.
    • getParentNameSpace

      public Namespace getParentNameSpace()
      Description copied from interface: ExternalLocation
      Returns the parent namespace containing this location.
      Specified by:
      getParentNameSpace in interface ExternalLocation
      Returns:
      the parent namespace containing this location.
    • getParentName

      public String getParentName()
      Description copied from interface: ExternalLocation
      Returns the name of the parent namespace containing this location.
      Specified by:
      getParentName in interface ExternalLocation
      Returns:
      the name of the parent namespace containing this location.
    • getLabel

      public String getLabel()
      Description copied from interface: ExternalLocation
      Returns the external label associated with this location.
      Specified by:
      getLabel in interface ExternalLocation
      Returns:
      the external label associated with this location.
    • getOriginalImportedName

      public String getOriginalImportedName()
      Description copied from interface: ExternalLocation
      Returns the original name for this location. Will be null if the name was never changed.
      Specified by:
      getOriginalImportedName in interface ExternalLocation
      Returns:
      the original name for this location. Will be null if the name was never changed.
    • getSource

      public SourceType getSource()
      Description copied from interface: ExternalLocation
      Returns the source of this location.
      Specified by:
      getSource in interface ExternalLocation
      Returns:
      the source
    • getAddress

      public Address getAddress()
      Description copied from interface: ExternalLocation
      Returns the external address if known, or null
      Specified by:
      getAddress in interface ExternalLocation
      Returns:
      the external address if known, or null
    • getExternalSpaceAddress

      public Address getExternalSpaceAddress()
      Description copied from interface: ExternalLocation
      Returns the address in "External" (fake) space where this location is stored.
      Specified by:
      getExternalSpaceAddress in interface ExternalLocation
      Returns:
      the address that represents this location in "External" space.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isFunction

      public boolean isFunction()
      Specified by:
      isFunction in interface ExternalLocation
      Returns:
      true if location corresponds to a function
    • getDataType

      public DataType getDataType()
      Description copied from interface: ExternalLocation
      Returns the DataType which has been associated with this location.
      Specified by:
      getDataType in interface ExternalLocation
    • setDataType

      public void setDataType(DataType dt)
      Description copied from interface: ExternalLocation
      Associate the specified data type with this location.
      Specified by:
      setDataType in interface ExternalLocation
      Parameters:
      dt - data type
    • getFunction

      public Function getFunction()
      Description copied from interface: ExternalLocation
      Returns the external function associated with this location or null if this is a data location.
      Specified by:
      getFunction in interface ExternalLocation
      Returns:
      external function associated with this location or null if this is a data location.
    • createFunction

      public Function createFunction()
      Description copied from interface: ExternalLocation
      Create an external function associated with this location or return the existing function if one already exists
      Specified by:
      createFunction in interface ExternalLocation
      Returns:
      external function
    • setLocation

      public void setLocation(String label, Address addr, SourceType source) throws InvalidInputException
      Description copied from interface: ExternalLocation
      Set the external label which defines this location.
      Specified by:
      setLocation in interface ExternalLocation
      Parameters:
      label - external label, may be null if addr is not null. Label may also be namespace qualified and best effort will be used to parse namespace (see SymbolPath). If a namespace is not included within label, the current namespace will be preserved. Note that this method does not properly handle the presence of template information within the label.
      addr - external address, may be null
      source - the source of the external label name
      Throws:
      InvalidInputException
    • setAddress

      public void setAddress(Address address) throws InvalidInputException
      Description copied from interface: ExternalLocation
      Sets the address in the external program associated with this location. The address may not be null if location has a default label.
      Specified by:
      setAddress in interface ExternalLocation
      Parameters:
      address - the address to set.
      Throws:
      InvalidInputException - if address is null and location currently has a default name
    • saveOriginalNameIfNeeded

      public void saveOriginalNameIfNeeded(Namespace oldNamespace, String oldName, SourceType oldSource)
    • setName

      public void setName(Namespace namespace, String newName, SourceType sourceType) throws InvalidInputException
      Description copied from interface: ExternalLocation
      Set a new name for this external location. The new name will become the primary symbol for this location. The current name for this location will be saved as the original symbol for this location.
      Specified by:
      setName in interface ExternalLocation
      Parameters:
      namespace - the namespace for the original symbol. Can be different than original symbol
      newName - the user-friendly name.
      sourceType - the SourceType for the new name.
      Throws:
      InvalidInputException - if the name contains illegal characters (space for example)
    • restoreOriginalName

      public void restoreOriginalName()
      Description copied from interface: ExternalLocation
      If this external location has a replacement name, then the primary symbol will be deleted and the original symbol will become the primary symbol, effectively restoring the location to it's original name.
      Specified by:
      restoreOriginalName in interface ExternalLocation
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isEquivalent

      public boolean isEquivalent(ExternalLocation other)
      Description copied from interface: ExternalLocation
      Returns true if the given external location has the same name, namespace, original import name, and external address.
      Specified by:
      isEquivalent in interface ExternalLocation
      Parameters:
      other - the other ExternalLocation to compare
      Returns:
      true if the other location is equivalent to this one.