Package ghidra.program.model.pcode
Class GlobalSymbolMap
- java.lang.Object
- 
- ghidra.program.model.pcode.GlobalSymbolMap
 
- 
 public class GlobalSymbolMap extends java.lang.ObjectA container for global symbols in the decompiler's model of a function. It contains HighSymbol objects for any symbol accessed by the particular function that is in either the global scope or some other global namespace. Currently the container is populated indirectly from the HighGlobal objects marshaled back from the decompiler, using either the populateSymbol() or newSymbol() methods. HighSymbols are stored by Address and by id, which matches the formal SymbolDB id when it exists.
- 
- 
Constructor SummaryConstructors Constructor Description GlobalSymbolMap(HighFunction f)Construct a global symbol map attached to a particular function model.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description HighSymbolgetSymbol(long id)Retrieve a HighSymbol based on an idHighSymbolgetSymbol(Address addr)Retrieve a HighSymbol based on an Addressjava.util.Iterator<HighSymbol>getSymbols()Get an iterator over all HighSymbols in this containerHighCodeSymbolnewSymbol(long id, Address addr, DataType dataType, int sz)Create a HighSymbol corresponding to an underlying Data object.HighSymbolpopulateSymbol(long id, DataType dataType, int sz)Create a HighSymbol based on the id of the underlying Ghidra Symbol.
 
- 
- 
- 
Constructor Detail- 
GlobalSymbolMappublic GlobalSymbolMap(HighFunction f) Construct a global symbol map attached to a particular function model.- Parameters:
- f- is the decompiler function model
 
 
- 
 - 
Method Detail- 
populateSymbolpublic HighSymbol populateSymbol(long id, DataType dataType, int sz) Create a HighSymbol based on the id of the underlying Ghidra Symbol. The Symbol is looked up in the SymbolTable and then a HighSymbol is created with the name and dataType associated with the Symbol. If a Symbol cannot be found, null is returned.- Parameters:
- id- is the database id of the CodeSymbol
- dataType- is the recovered data-type of the symbol
- sz- is the size in bytes of the desired symbol
- Returns:
- the CodeSymbol wrapped as a HighSymbol or null
 
 - 
newSymbolpublic HighCodeSymbol newSymbol(long id, Address addr, DataType dataType, int sz) Create a HighSymbol corresponding to an underlying Data object. The name of the symbol is generated dynamically. A symbol is always returned unless the address is invalid, in which case null is returned.- Parameters:
- id- is the id to associate with the new symbol
- addr- is the address of the Data object
- dataType- is the recovered data-type of the symbol
- sz- is the size in bytes of the symbol
- Returns:
- the new HighSymbol or null
 
 - 
getSymbolpublic HighSymbol getSymbol(long id) Retrieve a HighSymbol based on an id- Parameters:
- id- is the id
- Returns:
- the matching HighSymbol or null
 
 - 
getSymbolpublic HighSymbol getSymbol(Address addr) Retrieve a HighSymbol based on an Address- Parameters:
- addr- is the given Address
- Returns:
- the matching HighSymbol or null
 
 - 
getSymbolspublic java.util.Iterator<HighSymbol> getSymbols() Get an iterator over all HighSymbols in this container- Returns:
- the iterator
 
 
- 
 
-