Class ProgramAddressFactory

java.lang.Object
ghidra.program.model.address.DefaultAddressFactory
ghidra.program.database.ProgramAddressFactory
All Implemented Interfaces:
AddressFactory

public class ProgramAddressFactory extends DefaultAddressFactory
  • Field Details

  • Constructor Details

  • Method Details

    • invalidateOverlayCache

      public void invalidateOverlayCache()
    • getStackSpace

      public AddressSpace getStackSpace()
      Description copied from interface: AddressFactory
      Returns the "stack" address space.
      Specified by:
      getStackSpace in interface AddressFactory
      Overrides:
      getStackSpace in class DefaultAddressFactory
    • isValidOverlayBaseSpace

      protected boolean isValidOverlayBaseSpace(AddressSpace baseSpace)
      Determine whether the given space can have an overlay
      Parameters:
      baseSpace - the overlay base address space
      Returns:
      true to allow, false to prohibit
    • addOverlaySpace

      protected void addOverlaySpace(ProgramOverlayAddressSpace ovSpace) throws DuplicateNameException
      Add an overlay address space to this factory
      Parameters:
      ovSpace - overlay space
      Throws:
      DuplicateNameException - if name of overlay space already exists in this factory
    • addOverlaySpace

      protected ProgramOverlayAddressSpace addOverlaySpace(long key, String overlayName, AddressSpace baseSpace) throws DuplicateNameException
      Create a new ProgramOverlayAddressSpace based upon the given overlay blockName and base AddressSpace
      Parameters:
      key - overlay record key
      overlayName - overlay name
      baseSpace - the base AddressSpace to overlay
      Returns:
      the new overlay space
      Throws:
      DuplicateNameException - if overlay name duplicates another address space name
      IllegalArgumentException - if baseSpace is not permitted or not found.
    • checkValidOverlaySpaceName

      public void checkValidOverlaySpaceName(String name) throws InvalidNameException, DuplicateNameException
      Throws:
      InvalidNameException
      DuplicateNameException
    • getAddress

      public Address getAddress(int spaceID, long offset)
      Description copied from interface: AddressFactory
      Get an address using the addressSpace with the given id and having the given offset.
      Specified by:
      getAddress in interface AddressFactory
      Overrides:
      getAddress in class DefaultAddressFactory
      Parameters:
      spaceID - the id of the address space to use to create the new address.
      offset - the offset of the new address to be created.
      Returns:
      the new address.
    • getAddress

      public Address getAddress(String addrString)
      Description copied from interface: AddressFactory
      Create an address from String. Attempts to use the "default" address space first. Otherwise loops through each addressSpace, returning the first valid address that any addressSpace creates from the string. Returns an Address if the string is valid, otherwise null.
      Specified by:
      getAddress in interface AddressFactory
      Overrides:
      getAddress in class DefaultAddressFactory
      See Also:
    • removeOverlaySpace

      protected void removeOverlaySpace(String name)
      Remove an overlay space. It may be neccessary to invoke refreshStaleOverlayStatus() when an overlay is removed.
      Parameters:
      name - overlay space name
    • overlaySpaceRenamed

      protected void overlaySpaceRenamed(String oldOverlaySpaceName, String newName, boolean refreshStatusIfNeeded)
    • refreshStaleOverlayStatus

      protected void refreshStaleOverlayStatus()
      Examine all overlay spaces and update the stale status indicator (see hasStaleOverlays).
    • hasStaleOverlayCondition

      public boolean hasStaleOverlayCondition()
      Description copied from interface: AddressFactory
      Determine if this address factory contains a stale overlay address space whose name was recently changed. When this condition occurs, issues may arise when comparing Address and AddressSpace-related objects when overlay address spaces are involved. A common case for this is a Diff type operation.
      Returns:
      true if this factory contains one or more stale overlay address space instances.