Class HighCodeSymbol

java.lang.Object
ghidra.program.model.pcode.HighSymbol
ghidra.program.model.pcode.HighCodeSymbol

public class HighCodeSymbol extends HighSymbol
A global symbol as part of the decompiler's model of a function. This symbol can be backed by a formal CodeSymbol, obtained using getCodeSymbol(). This symbol can be backed by a formal Data object, obtained using getData(). If there is a backing CodeSymbol, this takes its name, otherwise the name is dynamically generated using SymbolUtilities. The data-type attached to this does not necessarily match the backing CodeSymbol or Data object.
  • Constructor Details

    • HighCodeSymbol

      public HighCodeSymbol(CodeSymbol sym, DataType dataType, int sz, HighFunction func)
      Construct with a backing CodeSymbol. An attempt is made to also find a backing Data object.
      Parameters:
      sym - is the backing CodeSymbol
      dataType - is the (possibly distinct) data-type associated with the new HighSymbol
      sz - is the storage size, in bytes, of the symbol
      func - is the decompiler function model owning the new HighSymbol
    • HighCodeSymbol

      public HighCodeSymbol(long id, Address addr, DataType dataType, int sz, HighFunction func)
      Construct with just a (global) storage address and size. There will be no backing CodeSymbol. An attempt is made to find a backing Data object.
      Parameters:
      id - is the id to associate with the new HighSymbol
      addr - is the starting Address of the symbol storage
      dataType - is the data-type associated with the new symbol
      sz - is the size of the symbol storage in bytes
      func - is the decompiler function model owning the new symbol
    • HighCodeSymbol

      public HighCodeSymbol(long id, String nm, Data data, PcodeDataTypeManager dtmanage)
      Constructor for HighSymbol which is unattached to a HighFunction
      Parameters:
      id - is the unique id to assign
      nm - is the name of the symbol
      data - is an underlying Data object defining the storage and data-type
      dtmanage - is the data-type manager for XML reference
  • Method Details

    • isGlobal

      public boolean isGlobal()
      Description copied from class: HighSymbol
      Is this symbol in the global scope or some other global namespace
      Overrides:
      isGlobal in class HighSymbol
      Returns:
      true if this is global
    • getCodeSymbol

      public CodeSymbol getCodeSymbol()
      Get the CodeSymbol backing this, if it exists
      Returns:
      the CodeSymbol or null
    • getData

      public Data getData()
      Get the Data object backing this, if it exists
      Returns:
      the Data object or null
    • decode

      public void decode(Decoder decoder) throws DecoderException
      Description copied from class: HighSymbol
      Decode this symbol object and its associated mappings from the stream.
      Overrides:
      decode in class HighSymbol
      Parameters:
      decoder - is the stream decoder
      Throws:
      DecoderException - for invalid encodings