Package ghidra.program.database.symbol
Class FunctionSymbol
java.lang.Object
ghidra.program.database.DatabaseObject
ghidra.program.database.symbol.SymbolDB
ghidra.program.database.symbol.FunctionSymbol
- All Implemented Interfaces:
- Symbol
Symbol class for functions.
 
 Symbol Data Usage:
   EXTERNAL:
        String stringData - external memory address/label
- 
Field SummaryFields inherited from class ghidra.program.database.DatabaseObjectkey
- 
Constructor SummaryConstructorsConstructorDescriptionFunctionSymbol(SymbolManager symbolMgr, DBObjectCache<SymbolDB> cache, Address address, DBRecord record) Construct a new FunctionSymbol
- 
Method SummaryModifier and TypeMethodDescriptionbooleandelete()Delete the symbol and its associated resources.protected StringThe code for creating the name content for this symbol.protected NamespaceReturns a program location for this symbol; may be null.intgetReferences(TaskMonitor monitor) Returns all memory references to the address of this symbol.Returns this symbol's typebooleanbooleanbooleanReturns true if this an external symbol.booleanisPinned()Returns true if the symbol is pinned to its current address.booleanbooleanisValidParent(Namespace parent) Determines if the given parent is valid for this Symbol.voidsetNameAndNamespace(String newName, Namespace newNamespace, SourceType source) Sets the symbols name and namespace.voidsetPinned(boolean pinned) Sets whether or not this symbol is pinned to its associated address.protected SourceTypevalidateNameSource(String newName, SourceType source) Allow symbol implementations to validate the source when setting the name of this symbolMethods inherited from class ghidra.program.database.symbol.SymbolDBcheckDeleted, doCheckIsPrimary, doIsPinned, doSetNameAndNamespace, doSetPinned, doSetPrimary, equals, getAddress, getDataTypeId, getID, getName, getName, getParentNamespace, getParentSymbol, getPath, getProgram, getReferences, getSource, getSymbolStringData, getVariableOffset, hashCode, isDeleted, isDeleting, isDescendant, isDynamic, isExternalEntryPoint, isGlobal, moveLowLevel, refresh, refresh, setAddress, setDataTypeId, setName, setNamespace, setPrimary, setSource, setSymbolStringData, setVariableOffset, toStringMethods inherited from class ghidra.program.database.DatabaseObjectcheckIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setDeleted, setInvalid, validate
- 
Constructor Details- 
FunctionSymbolpublic FunctionSymbol(SymbolManager symbolMgr, DBObjectCache<SymbolDB> cache, Address address, DBRecord record) Construct a new FunctionSymbol- Parameters:
- symbolMgr- the symbol manager.
- cache- symbol object cache
- address- the address for this symbol.
- record- the record for this symbol.
 
 
- 
- 
Method Details- 
getSymbolTypeDescription copied from interface:SymbolReturns this symbol's type- Returns:
- symbol type
 
- 
isExternalpublic boolean isExternal()Description copied from interface:SymbolReturns true if this an external symbol.- Returns:
- true if this an external symbol.
- See Also:
 
- 
setNameAndNamespacepublic void setNameAndNamespace(String newName, Namespace newNamespace, SourceType source) throws DuplicateNameException, InvalidInputException, CircularDependencyException Description copied from interface:SymbolSets the symbols name and namespace. This is provided to allow the caller to avoid a name conflict by creating an autonomous action.- Specified by:
- setNameAndNamespacein interface- Symbol
- Overrides:
- setNameAndNamespacein class- SymbolDB
- 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
 
- 
deletepublic boolean delete()Description copied from interface:SymbolDelete the symbol and its associated resources. Any references symbol associations will be discarded.
- 
getObject- Returns:
- object associated with this symbol or null if symbol has been deleted
 
- 
isPrimarypublic boolean isPrimary()
- 
isPinnedpublic boolean isPinned()Description copied from interface:SymbolReturns 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.
- 
setPinnedpublic void setPinned(boolean pinned) Description copied from interface:SymbolSets 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. 
- 
getProgramLocationDescription copied from interface:SymbolReturns a program location for this symbol; may be null. This allows implementations to return a more specific program location than what is typically used by the system.- Returns:
- the location
 
- 
isValidParentDescription copied from interface:SymbolDetermines if the given parent is valid for this Symbol. Specified namespace must belong to the same symbol table as this symbol.- Specified by:
- isValidParentin interface- Symbol
- Overrides:
- isValidParentin class- SymbolDB
- Parameters:
- parent- prospective parent namespace for this symbol
- Returns:
- true if parent is valid
 
- 
doGetNameDescription copied from class:SymbolDBThe code for creating the name content for this symbol. This code will be called with the symbol's lock.
- 
doGetParentNamespace- Overrides:
- doGetParentNamespacein class- SymbolDB
 
- 
validateNameSourceDescription copied from class:SymbolDBAllow symbol implementations to validate the source when setting the name of this symbol- Overrides:
- validateNameSourcein class- SymbolDB
- Parameters:
- newName- the new name
- source- the source type
- Returns:
- the validated source type
 
- 
getSymbolsDynamicallyRenamedByMyRename- Overrides:
- getSymbolsDynamicallyRenamedByMyRenamein class- SymbolDB
 
- 
getReferencesDescription copied from interface:SymbolReturns all memory references to the address of this symbol. If you do not have aTaskMonitorinstance, then you can passTaskMonitor.DUMMYornull.- Specified by:
- getReferencesin interface- Symbol
- Overrides:
- getReferencesin class- SymbolDB
- Parameters:
- monitor- the monitor that is used to report progress and to cancel this potentially long-running call
- Returns:
- all memory references to the address of this symbol.
 
- 
getReferenceCountpublic int getReferenceCount()- Specified by:
- getReferenceCountin interface- Symbol
- Overrides:
- getReferenceCountin class- SymbolDB
- Returns:
- the number of References to this symbol.
 
- 
hasMultipleReferencespublic boolean hasMultipleReferences()- Specified by:
- hasMultipleReferencesin interface- Symbol
- Overrides:
- hasMultipleReferencesin class- SymbolDB
- Returns:
- true if this symbol has more than one reference to it.
 
- 
hasReferencespublic boolean hasReferences()- Specified by:
- hasReferencesin interface- Symbol
- Overrides:
- hasReferencesin class- SymbolDB
- Returns:
- true if this symbol has at least one reference to it.
 
 
-