Package ghidra.program.model.pcode

# 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.

- ## Field Summary

  ### Fields inherited from class ghidra.program.model.pcode.HighSymbol

  `category, categoryIndex, dtmanage, entryList, function, ID_BASE, name, type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HighCodeSymbol(long id, Address addr, DataType dataType, int sz, HighFunction func)`
  Construct with just a (global) storage address and size.
  `HighCodeSymbol(long id, String nm, Data data, PcodeDataTypeManager dtmanage)`
  Constructor for HighSymbol which is unattached to a HighFunction
  `HighCodeSymbol(CodeSymbol sym, HighFunction func)`
  Construct with a backing CodeSymbol.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `decode(Decoder decoder)`
  Decode this symbol object and its associated mappings from the stream.
  `CodeSymbol`
  `getCodeSymbol()`
  Get the CodeSymbol backing this, if it exists
  `Data`
  `getData()`
  Get the Data object backing this, if it exists
  `boolean`
  `isGlobal()`
  Is this symbol in the global scope or some other global namespace

  ### Methods inherited from class ghidra.program.model.pcode.HighSymbol

  `addMapEntry, decodeHeader, decodeMapSym, encode, encodeHeader, encodeMapSym, getCategoryIndex, getDataType, getFirstUseOffset, getFirstWholeMap, getHighFunction, getHighVariable, getId, getMutability, getName, getNamespace, getPCAddress, getProgram, getSize, getStorage, getSymbol, isHiddenReturn, isIsolated, isNameLocked, isParameter, isThisPointer, isTypeLocked, setCategory, setNameLock, setTypeLock`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### HighCodeSymbol

    public HighCodeSymbol(CodeSymbol sym, HighFunction func)
    Construct with a backing CodeSymbol. An attempt is made to also find a backing Data object.
    Parameters:
      `sym` - is the backing CodeSymbol
      `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