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, 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, java.lang.String nm, Data data, PcodeDataTypeManager dtmanage)
Constructor for HighSymbol which is unattached to a HighFunctionHighCodeSymbol(CodeSymbol sym, DataType dataType, int sz, HighFunction func)
Construct with a backing CodeSymbol.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodeSymbol
getCodeSymbol()
Get the CodeSymbol backing this, if it existsData
getData()
Get the Data object backing this, if it existsboolean
isGlobal()
Is this symbol in the global scope or some other global namespacevoid
restoreXML(XmlPullParser parser)
Restore this symbol object and its associated mappings from an XML description in the given stream.-
Methods inherited from class ghidra.program.model.pcode.HighSymbol
addMapEntry, buildMapSymXML, getCategoryIndex, getDataType, getFirstUseOffset, getFirstWholeMap, getHighFunction, getHighVariable, getId, getName, getNamespace, getPCAddress, getProgram, getSize, getStorage, getSymbol, isHiddenReturn, isIsolated, isNameLocked, isParameter, isReadOnly, isThisPointer, isTypeLocked, restoreMapSymXML, restoreXMLHeader, saveXML, saveXMLHeader, setCategory, setHighVariable, setNameLock, setTypeLock
-
-
-
-
Constructor Detail
-
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 CodeSymboldataType
- is the (possibly distinct) data-type associated with the new HighSymbolsz
- is the storage size, in bytes, of the symbolfunc
- 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 HighSymboladdr
- is the starting Address of the symbol storagedataType
- is the data-type associated with the new symbolsz
- is the size of the symbol storage in bytesfunc
- is the decompiler function model owning the new symbol
-
HighCodeSymbol
public HighCodeSymbol(long id, java.lang.String nm, Data data, PcodeDataTypeManager dtmanage)
Constructor for HighSymbol which is unattached to a HighFunction- Parameters:
id
- is the unique id to assignnm
- is the name of the symboldata
- is an underlying Data object defining the storage and data-typedtmanage
- is the data-type manager for XML reference
-
-
Method Detail
-
isGlobal
public boolean isGlobal()
Description copied from class:HighSymbol
Is this symbol in the global scope or some other global namespace- Overrides:
isGlobal
in classHighSymbol
- 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
-
restoreXML
public void restoreXML(XmlPullParser parser) throws PcodeXMLException
Description copied from class:HighSymbol
Restore this symbol object and its associated mappings from an XML description in the given stream.- Overrides:
restoreXML
in classHighSymbol
- Parameters:
parser
- is the given XML stream- Throws:
PcodeXMLException
- if the XML description is invalid
-
-