Class RelocationManager

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Relocation add​(Address addr, int type, long[] values, byte[] bytes, java.lang.String symbolName)
      Creates and adds a new relocation with the specified address, type, and value.
      void deleteAddressRange​(Address startAddr, Address endAddr, TaskMonitor monitor)
      Delete all objects which have been applied to the address range startAddr to endAddr and update the database accordingly.
      Relocation getRelocation​(Address addr)
      Returns the relocation with the specified address.
      Relocation getRelocationAfter​(Address addr)
      Returns the next relocation point which follows the specified address.
      java.util.Iterator<Relocation> getRelocations()
      Returns an iterator over all relocation points (in ascending address order) located within the program.
      java.util.Iterator<Relocation> getRelocations​(AddressSetView set)
      Returns an iterator over all the relocation points (in ascending address order) located within the specified address set.
      int getSize()
      Returns the number of relocation in this table.
      void invalidateCache​(boolean all)
      Clears all data caches.
      boolean isRelocatable()
      Returns true if this relocation table contains relocations for a relocatable binary.
      void moveAddressRange​(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
      Move all objects within an address range to a new location.
      void programReady​(int openMode, int currentRevision, TaskMonitor monitor)
      Callback from program made to each manager after the program has completed initialization.
      void remove​(Relocation reloc)
      Removes the relocation object.
      void setProgram​(ProgramDB p)
      Callback from program used to indicate all manager have been created.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RelocationManager

        public RelocationManager​(DBHandle handle,
                                 AddressMap addrMap,
                                 int openMode,
                                 Lock lock,
                                 TaskMonitor monitor)
                          throws VersionException,
                                 java.io.IOException
        Constructs a new relocation manager.
        Parameters:
        handle - the database handle
        addrMap - the address map
        openMode - the open mode; CREATE, UPDATE, READONLY, UPGRADE
        lock - the program synchronization lock
        monitor - the task monitor
        Throws:
        VersionException
        java.io.IOException
        CancelledException
    • Method Detail

      • invalidateCache

        public void invalidateCache​(boolean all)
        Description copied from interface: ManagerDB
        Clears all data caches.
        Specified by:
        invalidateCache in interface ManagerDB
        Parameters:
        all - if false, some managers may not need to update their cache if they can tell that its not necessary. If this flag is true, then all managers should clear their cache no matter what.
      • setProgram

        public void setProgram​(ProgramDB p)
        Description copied from interface: ManagerDB
        Callback from program used to indicate all manager have been created. When this method is invoked, all managers have been instantiated but may not be fully initialized.
        Specified by:
        setProgram in interface ManagerDB
        Parameters:
        p - the program is set when all the initializations have been completed.
      • programReady

        public void programReady​(int openMode,
                                 int currentRevision,
                                 TaskMonitor monitor)
                          throws java.io.IOException,
                                 CancelledException
        Description copied from interface: ManagerDB
        Callback from program made to each manager after the program has completed initialization. This method may be used by managers to perform additional upgrading which may have been deferred.
        Specified by:
        programReady in interface ManagerDB
        Parameters:
        openMode - the mode that the program is being opened.
        currentRevision - current program revision. If openMode is UPGRADE, this value reflects the pre-upgrade value.
        monitor - the task monitor to use in any upgrade operations.
        Throws:
        java.io.IOException - if a database io error occurs.
        CancelledException - if the user cancelled the operation via the task monitor.
      • add

        public Relocation add​(Address addr,
                              int type,
                              long[] values,
                              byte[] bytes,
                              java.lang.String symbolName)
        Description copied from interface: RelocationTable
        Creates and adds a new relocation with the specified address, type, and value.
        Specified by:
        add in interface RelocationTable
        Parameters:
        addr - the address where the relocation is required
        type - the type of relocation to perform
        values - the values needed when performing the relocation
        bytes - original instruction bytes affected by relocation
        Returns:
        the newly added relocation object
      • remove

        public void remove​(Relocation reloc)
        Description copied from interface: RelocationTable
        Removes the relocation object.
        Specified by:
        remove in interface RelocationTable
        Parameters:
        reloc - the relocation object to remove
      • getRelocation

        public Relocation getRelocation​(Address addr)
        Description copied from interface: RelocationTable
        Returns the relocation with the specified address.
        Specified by:
        getRelocation in interface RelocationTable
        Parameters:
        addr - the address where the relocation is defined
        Returns:
        the relocation with the specified address
      • getRelocations

        public java.util.Iterator<Relocation> getRelocations()
        Description copied from interface: RelocationTable
        Returns an iterator over all relocation points (in ascending address order) located within the program.
        Specified by:
        getRelocations in interface RelocationTable
        Returns:
        relocation iterator
      • getRelocationAfter

        public Relocation getRelocationAfter​(Address addr)
        Description copied from interface: RelocationTable
        Returns the next relocation point which follows the specified address.
        Specified by:
        getRelocationAfter in interface RelocationTable
        Parameters:
        addr - starting point
        Returns:
        next relocation after addr
      • getRelocations

        public java.util.Iterator<Relocation> getRelocations​(AddressSetView set)
        Description copied from interface: RelocationTable
        Returns an iterator over all the relocation points (in ascending address order) located within the specified address set.
        Specified by:
        getRelocations in interface RelocationTable
        Parameters:
        set - address set
        Returns:
        relocation iterator
      • getSize

        public int getSize()
        Description copied from interface: RelocationTable
        Returns the number of relocation in this table.
        Specified by:
        getSize in interface RelocationTable
        Returns:
        the number of relocation in this table
      • isRelocatable

        public boolean isRelocatable()
        Description copied from interface: RelocationTable
        Returns true if this relocation table contains relocations for a relocatable binary. Some binaries may contain relocations, but not actually be relocatable. For example, ELF executables.
        Specified by:
        isRelocatable in interface RelocationTable
        Returns:
        true if this relocation table contains relocations for a relocatable binary
      • deleteAddressRange

        public void deleteAddressRange​(Address startAddr,
                                       Address endAddr,
                                       TaskMonitor monitor)
        Description copied from interface: ManagerDB
        Delete all objects which have been applied to the address range startAddr to endAddr and update the database accordingly.
        Specified by:
        deleteAddressRange in interface ManagerDB
        Parameters:
        startAddr - the first address in the range.
        endAddr - the last address in the range.
        monitor - the task monitor to use in any upgrade operations.
      • moveAddressRange

        public void moveAddressRange​(Address fromAddr,
                                     Address toAddr,
                                     long length,
                                     TaskMonitor monitor)
        Description copied from interface: ManagerDB
        Move all objects within an address range to a new location.
        Specified by:
        moveAddressRange in interface ManagerDB
        Parameters:
        fromAddr - the first address of the range to be moved.
        toAddr - the address where to the range is to be moved.
        length - the number of addresses to move.
        monitor - the task monitor to use in any upgrade operations.