Package ghidra.program.database.symbol
Class FunctionSymbol
- java.lang.Object
-
- ghidra.program.database.DatabaseObject
-
- ghidra.program.database.symbol.SymbolDB
-
- ghidra.program.database.symbol.FunctionSymbol
-
-
Constructor Summary
Constructors Constructor Description FunctionSymbol(SymbolManager symbolMgr, DBObjectCache<SymbolDB> cache, Address address, Record record)
Construct a new FunctionSymbol
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete()
Delete the symbol and its associated resources.java.lang.String
getName()
java.lang.Object
getObject()
ProgramLocation
getProgramLocation()
int
getReferenceCount()
Reference[]
getReferences(TaskMonitor monitor)
Returns all memory references to the address of this symbol.protected java.util.List<SymbolDB>
getSymbolsDynamicallyRenamedByMyRename()
SymbolType
getSymbolType()
Returns the symbol typeboolean
hasMultipleReferences()
boolean
hasReferences()
boolean
isExternal()
Returns true if this an external symbol.boolean
isPinned()
Returns true if the symbol is pinned to its current address.boolean
isPrimary()
boolean
isValidParent(Namespace parent)
Returns whether the given parent is valid for this Symbol.void
setNameAndNamespace(java.lang.String newName, Namespace newNamespace, SourceType source)
Sets the symbols name and namespace.void
setPinned(boolean pinned)
Sets whether or not this symbol is pinned to its associated address.protected SourceType
validateNameSource(java.lang.String newName, SourceType source)
Allow symbol implementations to validate the source when setting the name of this symbol.-
Methods inherited from class ghidra.program.database.symbol.SymbolDB
doIsPinned, doSetPinned, equals, getAddress, getID, getName, getParentNamespace, getParentSymbol, getPath, getProgram, getReferences, getSource, getSymbolData1, getSymbolData2, getSymbolData3, hashCode, isDeleting, isDescendant, isDynamic, isExternalEntryPoint, isGlobal, move, refresh, refresh, removeAllReferencesTo, setAddress, setName, setNamespace, setPrimary, setSource, setSymbolData1, setSymbolData2, setSymbolData3, toString
-
Methods inherited from class ghidra.program.database.DatabaseObject
checkDeleted, checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setInvalid, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ghidra.program.model.symbol.Symbol
checkIsValid
-
-
-
-
Constructor Detail
-
FunctionSymbol
public FunctionSymbol(SymbolManager symbolMgr, DBObjectCache<SymbolDB> cache, Address address, Record record)
Construct a new FunctionSymbol- Parameters:
symbolMgr
- the symbol manager.cache
- symbol object cacheaddress
- the address for this symbol.record
- the record for this symbol.
-
-
Method Detail
-
getSymbolType
public SymbolType getSymbolType()
Description copied from interface:Symbol
Returns the symbol type- See Also:
Symbol.getSymbolType()
-
isExternal
public boolean isExternal()
Description copied from interface:Symbol
Returns true if this an external symbol.- Returns:
- true if this an external symbol.
- See Also:
Address.isExternalAddress()
-
setNameAndNamespace
public void setNameAndNamespace(java.lang.String newName, Namespace newNamespace, SourceType source) throws DuplicateNameException, InvalidInputException, CircularDependencyException
Description copied from interface:Symbol
Sets the symbols name and namespace. This is provided to allow the caller to avoid a name conflict by creating an autonomous action.- Specified by:
setNameAndNamespace
in interfaceSymbol
- Overrides:
setNameAndNamespace
in classSymbolDB
- Parameters:
newName
- new symbol namenewNamespace
- new parent namespacesource
- 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 nameInvalidInputException
- is newNamespace is not a valid parent for this symbolCircularDependencyException
- if this symbol is an ancestor of newNamespace
-
delete
public boolean delete()
Description copied from interface:Symbol
Delete the symbol and its associated resources.- Specified by:
delete
in interfaceSymbol
- Overrides:
delete
in classSymbolDB
- See Also:
Symbol.delete()
-
getObject
public java.lang.Object getObject()
- See Also:
Symbol.getObject()
-
isPrimary
public boolean isPrimary()
- Specified by:
isPrimary
in interfaceSymbol
- Specified by:
isPrimary
in classSymbolDB
- See Also:
Symbol.isPrimary()
-
isPinned
public boolean isPinned()
Description copied from interface:Symbol
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.
-
setPinned
public void setPinned(boolean pinned)
Description copied from interface:Symbol
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.
-
getProgramLocation
public ProgramLocation getProgramLocation()
- See Also:
Symbol.getProgramLocation()
-
isValidParent
public boolean isValidParent(Namespace parent)
Description copied from interface:Symbol
Returns whether the given parent is valid for this Symbol.- Specified by:
isValidParent
in interfaceSymbol
- Specified by:
isValidParent
in classSymbolDB
- See Also:
Symbol.isValidParent(ghidra.program.model.symbol.Namespace)
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceSymbol
- Overrides:
getName
in classSymbolDB
- See Also:
Symbol.getName()
-
validateNameSource
protected SourceType validateNameSource(java.lang.String newName, SourceType source)
Description copied from class:SymbolDB
Allow symbol implementations to validate the source when setting the name of this symbol.- Overrides:
validateNameSource
in classSymbolDB
-
getSymbolsDynamicallyRenamedByMyRename
protected java.util.List<SymbolDB> getSymbolsDynamicallyRenamedByMyRename()
- Overrides:
getSymbolsDynamicallyRenamedByMyRename
in classSymbolDB
-
getReferences
public Reference[] getReferences(TaskMonitor monitor)
Description copied from interface:Symbol
Returns all memory references to the address of this symbol. If you do not have aTaskMonitor
instance, then you can passTaskMonitorAdapter.DUMMY_MONITOR
or null.- Specified by:
getReferences
in interfaceSymbol
- Overrides:
getReferences
in classSymbolDB
- Parameters:
monitor
- the monitor that is used to report progress and to cancel this potentially long-running call
-
getReferenceCount
public int getReferenceCount()
- Specified by:
getReferenceCount
in interfaceSymbol
- Overrides:
getReferenceCount
in classSymbolDB
-
hasMultipleReferences
public boolean hasMultipleReferences()
- Specified by:
hasMultipleReferences
in interfaceSymbol
- Overrides:
hasMultipleReferences
in classSymbolDB
-
hasReferences
public boolean hasReferences()
- Specified by:
hasReferences
in interfaceSymbol
- Overrides:
hasReferences
in classSymbolDB
-
-