Class CodeSymbol

  • All Implemented Interfaces:
    Symbol

    public class CodeSymbol
    extends SymbolDB
    Symbols that represent "labels" Symbol data usage: EXTERNAL: long data1 - external data type String data3 - external memory address NON-EXTERNAL: int data2 - primary flag
    • Constructor Detail

      • CodeSymbol

        public CodeSymbol​(SymbolManager mgr,
                          DBObjectCache<SymbolDB> cache,
                          Address addr,
                          Record record)
        Constructs a new CodeSymbol
        Parameters:
        mgr - the symbol manager
        cache - symbol object cache
        addr - the address associated with the symbol
        record - the record for this symbol
      • CodeSymbol

        public CodeSymbol​(SymbolManager mgr,
                          DBObjectCache<SymbolDB> cache,
                          Address addr,
                          long key)
        Constructs a new CodeSymbol for a default/dynamic label.
        Parameters:
        mgr - the symbol manager
        cache - symbol object cache
        addr - the address associated with the symbol
        key - this must be the absolute encoding of addr
    • Method Detail

      • refresh

        protected boolean refresh​(Record rec)
        Description copied from class: DatabaseObject
        Tells the object to refresh its state from the database using the specified record if not null. NOTE: The default implementation ignores the record and invokes refresh(). Implementations of this method must take care if multiple database tables are used since the record supplied could correspond to another object. In some cases it may be best not to override this method or ignore the record provided.
        Overrides:
        refresh in class SymbolDB
        Parameters:
        rec - valid record associated with object's key (optional, may be null to force record lookup or other refresh technique)
        Returns:
        true if the object was able to refresh itself. Return false if record is null and object was deleted. Objects that extend this class must implement a refresh method. If an object can never refresh itself, then it should always return false.
      • isExternal

        public boolean isExternal()
        Description copied from interface: Symbol
        Returns true if this an external symbol.
        Returns:
        true if this an external symbol.
        See Also:
        Address.isExternalAddress()
      • delete

        public boolean delete()
        Description copied from interface: Symbol
        Delete the symbol and its associated resources.
        Specified by:
        delete in interface Symbol
        Overrides:
        delete in class SymbolDB
      • delete

        public boolean delete​(boolean keepReferences)
      • isPinned

        public boolean isPinned()
        Description copied from interface: Symbol
        Returns true if the symbol is pinned to its current address. If it is pinned, then moving or removing the memory associated with that address will not affect this symbol.
        Specified by:
        isPinned in interface Symbol
        Overrides:
        isPinned in class SymbolDB
      • setPinned

        public void setPinned​(boolean pinned)
        Description copied from interface: Symbol

        Sets whether or not this symbol is pinned to its associated address.

        If the symbol is pinned then moving or removing the memory associated with its address will not cause this symbol to be removed and will not cause its address to change. If the symbol is not pinned, then removing the memory at its address will also remove this symbol.

        Likewise, moving a memory block containing a symbol that is not anchored will change the address for that symbol to keep it associated with the same byte in the memory block.

        Specified by:
        setPinned in interface Symbol
        Overrides:
        setPinned in class SymbolDB
        Parameters:
        pinned - true indicates this symbol is anchored to its address. false indicates this symbol is not anchored to its address.
      • setPrimary

        public boolean setPrimary()
        Description copied from interface: Symbol
        Sets this symbol to be primary. All other symbols at the same address will be set to !primary. Only applies to non-function symbols.
        Specified by:
        setPrimary in interface Symbol
        Overrides:
        setPrimary in class SymbolDB
        Returns:
        returns true if the symbol was not primary and now it is, otherwise false
        See Also:
        Symbol.setPrimary()
      • validateNameSource

        protected SourceType validateNameSource​(java.lang.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