Class FunctionSymbol

All Implemented Interfaces:
Symbol

public class FunctionSymbol extends MemorySymbol
Symbol class for functions.
  • Constructor Details

    • FunctionSymbol

      public FunctionSymbol(SymbolManager symbolMgr, DBObjectCache<SymbolDB> cache, Address address, DBRecord record)
      Construct a new FunctionSymbol
      Parameters:
      symbolMgr - the symbol manager.
      cache - symbol object cache
      address - the address for this symbol.
      record - the record for this symbol.
  • Method Details

    • getSymbolType

      public SymbolType getSymbolType()
      Description copied from interface: Symbol
      Returns this symbol's type
      Returns:
      symbol type
    • setNameAndNamespace

      public void setNameAndNamespace(String newName, Namespace newNamespace, SourceType source) throws DuplicateNameException, InvalidInputException, CircularDependencyException
      Description copied from interface: Symbol
      Sets the symbols name and namespace. This is provided to allow the caller to avoid a name conflict by creating an autonomous action.
      Specified by:
      setNameAndNamespace in interface Symbol
      Overrides:
      setNameAndNamespace in class SymbolDB
      Parameters:
      newName - new symbol name
      newNamespace - new parent namespace
      source - the source of this symbol
      Some symbol types, such as function symbols, can set the source to Symbol.DEFAULT.
      Throws:
      DuplicateNameException - if newNamespace already contains a symbol with this symbol's name
      InvalidInputException - is newNamespace is not a valid parent for this symbol
      CircularDependencyException - if this symbol is an ancestor of newNamespace
    • delete

      public boolean delete()
      Description copied from interface: Symbol
      Delete the symbol and its associated resources. Any references symbol associations will be discarded.
      Specified by:
      delete in interface Symbol
      Overrides:
      delete in class SymbolDB
      Returns:
      true if successful
    • getObject

      public Function getObject()
      Returns:
      object associated with this symbol or null if symbol has been deleted
    • isPrimary

      public boolean isPrimary()
      Specified by:
      isPrimary in interface Symbol
      Specified by:
      isPrimary in class SymbolDB
      Returns:
      true if this symbol is primary
    • getProgramLocation

      public ProgramLocation getProgramLocation()
      Description copied from interface: Symbol
      Returns a program location for this symbol; may be null. This allows implementations to return a more specific program location than what is typically used by the system.
      Returns:
      the location
    • isValidParent

      public boolean isValidParent(Namespace parent)
      Description copied from interface: Symbol
      Determines if the given parent is valid for this Symbol. Specified namespace must belong to the same symbol table as this symbol.
      Specified by:
      isValidParent in interface Symbol
      Overrides:
      isValidParent in class SymbolDB
      Parameters:
      parent - prospective parent namespace for this symbol
      Returns:
      true if parent is valid
    • doGetName

      protected String doGetName()
      Description copied from class: SymbolDB
      The code for creating the name content for this symbol. This code will be called with the symbol's lock.
      Overrides:
      doGetName in class SymbolDB
      Returns:
      the name
    • doGetParentNamespace

      protected Namespace doGetParentNamespace()
      Overrides:
      doGetParentNamespace in class SymbolDB
    • validateNameSource

      protected SourceType validateNameSource(String newName, SourceType source)
      Description copied from class: SymbolDB
      Allow symbol implementations to validate the source when setting the name of this symbol
      Overrides:
      validateNameSource in class SymbolDB
      Parameters:
      newName - the new name
      source - the source type
      Returns:
      the validated source type
    • getSymbolsDynamicallyRenamedByMyRename

      protected List<SymbolDB> getSymbolsDynamicallyRenamedByMyRename()
      Overrides:
      getSymbolsDynamicallyRenamedByMyRename in class SymbolDB
    • getReferences

      public Reference[] getReferences(TaskMonitor monitor)
      Description copied from interface: Symbol
      Returns all memory references to the address of this symbol. If you do not have a TaskMonitor instance, then you can pass TaskMonitor.DUMMY or null.
      Specified by:
      getReferences in interface Symbol
      Overrides:
      getReferences in class MemorySymbol
      Parameters:
      monitor - the monitor that is used to report progress and to cancel this potentially long-running call
      Returns:
      all memory references to the address of this symbol.
    • getReferenceCount

      public int getReferenceCount()
      Description copied from interface: Symbol
      Get the number of References to this symbol or its address.

      NOTE: this method differ from Symbol.hasReferences() behavior for memory symbols since this method will return ReferenceManager.getReferenceCountTo(Address) if this is the only symbol at its address.

      Specified by:
      getReferenceCount in interface Symbol
      Overrides:
      getReferenceCount in class MemorySymbol
      Returns:
      the number of References to this symbol or its address.
    • hasReferences

      public boolean hasReferences()
      Specified by:
      hasReferences in interface Symbol
      Overrides:
      hasReferences in class MemorySymbol
      Returns:
      true if this symbol has at least one reference to it. Explicit references to other symbols at the same address are not considered (see Reference.getSymbolID() which indicates a specific symbol reference).