Package ghidra.program.model.symbol
Interface Symbol
- 
- All Known Implementing Classes:
- ClassSymbol,- CodeSymbol,- FunctionSymbol,- GlobalRegisterSymbol,- GlobalSymbol,- GlobalVariableSymbolDB,- LibrarySymbol,- NamespaceSymbol,- SymbolDB,- VariableSymbolDB
 
 public interface SymbolInterface for a symbol, which associates a string value with an address.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancheckIsValid()Check whether this symbol is still valid (i.e., deleted).booleandelete()Delete the symbol and its associated resources.AddressgetAddress()longgetID()java.lang.StringgetName()java.lang.StringgetName(boolean includeNamespace)Returns the symbol name, optionally prepended with the namespace path.java.lang.ObjectgetObject()NamespacegetParentNamespace()SymbolgetParentSymbol()Returns namespace symbol of the namespace containing this symboljava.lang.String[]getPath()Gets the full path name for this symbol as an ordered array of strings ending with the symbol name.ProgramgetProgram()ProgramLocationgetProgramLocation()intgetReferenceCount()Reference[]getReferences()Returns all memory references to the address of this symbol.Reference[]getReferences(TaskMonitor monitor)Returns all memory references to the address of this symbol.SourceTypegetSource()Gets the source of this symbol.SymbolTypegetSymbolType()Returns the symbol typebooleanhasMultipleReferences()booleanhasReferences()booleanisDescendant(Namespace namespace)Returns true if the given namespace symbol is a descendant of this symbol.booleanisDynamic()booleanisExternal()Returns true if this an external symbol.booleanisExternalEntryPoint()booleanisGlobal()booleanisPinned()Returns true if the symbol is pinned to its current address.booleanisPrimary()booleanisValidParent(Namespace parent)Returns whether the given parent is valid for this Symbol.voidsetName(java.lang.String newName, SourceType source)Sets the name this symbol.voidsetNameAndNamespace(java.lang.String newName, Namespace newNamespace, SourceType source)Sets the symbols name and namespace.voidsetNamespace(Namespace newNamespace)Sets the symbols namespacevoidsetPinned(boolean pinned)Sets whether or not this symbol is pinned to its associated address.booleansetPrimary()Sets this symbol to be primary.voidsetSource(SourceType source)Sets the source of this symbol.
 
- 
- 
- 
Method Detail- 
getAddressAddress getAddress() 
 - 
getNamejava.lang.String getName() 
 - 
checkIsValidboolean checkIsValid() Check whether this symbol is still valid (i.e., deleted).- Returns:
- true if valid or false if deleted.
 
 - 
getPathjava.lang.String[] getPath() Gets the full path name for this symbol as an ordered array of strings ending with the symbol name. The global symbol will return an empty array.
 - 
getProgramProgram getProgram() 
 - 
getNamejava.lang.String getName(boolean includeNamespace) Returns the symbol name, optionally prepended with the namespace path.- Parameters:
- includeNamespace- if true, the namespace path is prepended to the name.
 
 - 
getParentNamespaceNamespace getParentNamespace() 
 - 
getParentSymbolSymbol getParentSymbol() Returns namespace symbol of the namespace containing this symbol
 - 
isDescendantboolean isDescendant(Namespace namespace) Returns true if the given namespace symbol is a descendant of this symbol.- Parameters:
- namespace- to test as descendant symbol of this Symbol
- Returns:
- true if this symbol is an ancestor of the given namespace symbol
 
 - 
isValidParentboolean isValidParent(Namespace parent) Returns whether the given parent is valid for this Symbol.- Parameters:
- parent-
 
 - 
getSymbolTypeSymbolType getSymbolType() Returns the symbol type
 - 
getReferenceCountint getReferenceCount() 
 - 
hasMultipleReferencesboolean hasMultipleReferences() 
 - 
hasReferencesboolean hasReferences() 
 - 
getReferencesReference[] getReferences(TaskMonitor monitor) Returns all memory references to the address of this symbol. If you do not have aTaskMonitorinstance, then you can passTaskMonitorAdapter.DUMMY_MONITORor null.- Parameters:
- monitor- the monitor that is used to report progress and to cancel this potentially long-running call
 
 - 
getReferencesReference[] getReferences() Returns all memory references to the address of this symbol.- See Also:
- getReferences(TaskMonitor)
 
 - 
getProgramLocationProgramLocation getProgramLocation() 
 - 
setNamevoid setName(java.lang.String newName, SourceType source) throws DuplicateNameException, InvalidInputExceptionSets the name this symbol. If this symbol is dynamic, then the name is set and the symbol is no longer dynamic.- Parameters:
- newName- the new name for this symbol.
- source- the source of this symbol
 Some symbol types, such as function symbols, can set the source to Symbol.DEFAULT.
- Throws:
- DuplicateNameException- if name already exists as the name of another symbol or alias.
- InvalidInputException- if alias contains blank characters, is zero length, or is null
- java.lang.IllegalArgumentException- if you try to set the source to DEFAULT for a symbol type that doesn't allow it.
 
 - 
setNamespacevoid setNamespace(Namespace newNamespace) throws DuplicateNameException, InvalidInputException, CircularDependencyException Sets the symbols namespace- Parameters:
- newNamespace- new parent namespace
- Throws:
- DuplicateNameException- if newNamespace already contains a symbol with this symbol's name
- InvalidInputException- is newNamespace is not a valid parent for this symbol
- CircularDependencyException- if this symbol is an ancestor of newNamespace
 
 - 
setNameAndNamespacevoid setNameAndNamespace(java.lang.String newName, Namespace newNamespace, SourceType source) throws DuplicateNameException, InvalidInputException, CircularDependencyExceptionSets the symbols name and namespace. This is provided to allow the caller to avoid a name conflict by creating an autonomous action.- Parameters:
- newName- new symbol name
- newNamespace- new parent namespace
- source- the source of this symbol
 Some symbol types, such as function symbols, can set the source to Symbol.DEFAULT.
- Throws:
- DuplicateNameException- if newNamespace already contains a symbol with this symbol's name
- InvalidInputException- is newNamespace is not a valid parent for this symbol
- CircularDependencyException- if this symbol is an ancestor of newNamespace
 
 - 
deleteboolean delete() Delete the symbol and its associated resources.
 - 
isPinnedboolean isPinned() 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.
 - 
setPinnedvoid setPinned(boolean pinned) 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. - Parameters:
- pinned- true indicates this symbol is anchored to its address. false indicates this symbol is not anchored to its address.
 
 - 
isDynamicboolean isDynamic() 
 - 
isExternalboolean isExternal() Returns true if this an external symbol.- Returns:
- true if this an external symbol.
- See Also:
- Address.isExternalAddress()
 
 - 
isPrimaryboolean isPrimary() 
 - 
setPrimaryboolean setPrimary() Sets this symbol to be primary. All other symbols at the same address will be set to !primary. Only applies to non-function symbols.- Returns:
- returns true if the symbol was not primary and now it is, otherwise false
 
 - 
isExternalEntryPointboolean isExternalEntryPoint() 
 - 
getIDlong getID() 
 - 
getObjectjava.lang.Object getObject() 
 - 
isGlobalboolean isGlobal() 
 - 
setSourcevoid setSource(SourceType source) Sets the source of this symbol.SourceTypes- Parameters:
- source- the new source of this symbol
 
 - 
getSourceSourceType getSource() Gets the source of this symbol.SourceTypes- Returns:
- the source of this symbol
 
 
- 
 
-