Class CodeSymbol
java.lang.Object
ghidra.program.database.DbObject
ghidra.program.database.symbol.SymbolDB
ghidra.program.database.symbol.MemorySymbol
ghidra.program.database.symbol.CodeSymbol
- All Implemented Interfaces:
Symbol
Symbols that represent "labels" or external data locations
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleandelete()Delete the symbol and its associated resources.booleandelete(boolean keepReferences) Delete code/label symbolprotected StringThe code for creating the name content for this symbol.Returns a program location for this symbol; may be null.Returns this symbol's typebooleanbooleanisValidParent(Namespace parent) Determines if the given parent is valid for this Symbol.protected booleanTells the object to refresh its state from the database using the specified record if provided.booleanSets this symbol to be primary.protected SourceTypevalidateNameSource(String newName, SourceType source) Allow symbol implementations to validate the source when setting the name of this symbolMethods inherited from class MemorySymbol
getExternalOriginalImportedName, getExternalProgramAddress, getReferenceCount, getReferences, hasReferences, isExternal, isExternalEntryPoint, isPinned, moveLowLevel, setExternalOriginalImportedName, setExternalProgramAddress, setPinnedMethods inherited from class SymbolDB
checkDeleted, doCheckIsPrimary, doGetParentNamespace, doSetNameAndNamespace, doSetPrimary, equals, getAddress, getDataTypeId, getID, getName, getName, getParentNamespace, getParentSymbol, getPath, getProgram, getSource, getSymbolsDynamicallyRenamedByMyRename, hashCode, isDeleted, isDeleting, isDescendant, isDynamic, isGlobal, setAddress, setDataTypeId, setName, setNameAndNamespace, setNamespace, setSource, setSourceFlagBits, toString, updateRecordMethods inherited from class DbObject
getKey, isDeleted, isValid, keyChanged, needsRefreshing, refreshIfNeeded, setDeleted, setInvalid, setValid, validateMethods inherited from interface Symbol
getReferences
-
Method Details
-
getSymbolType
-
refresh
Description copied from class:DbObjectTells the object to refresh its state from the database using the specified record if provided. The record may be null and the object is generally expected to be able to retrieve its own record from the database as needed. Is is mostly passed as a parameter for efficiency to keep an object from having to look up its record when the client already has the record in hand such as when it is iterating over records.This method generally should not be called directly as it provides no recursion protection. Instead, most clients should call
DbObject.refreshIfNeeded()instead which WILL provide recursion protection. If clients must call this method, they either need to provided their own recursion protection or be absolutely certain that recursive calls won't occur.- Overrides:
refreshin classSymbolDB- Parameters:
rec- valid record associated with object's key (optional, may be null to force record lookup or other refresh technique)- Returns:
- true if the object was able to refresh itself. Return false if record is null and object was deleted. Objects that extend this class must implement a refresh method. If an object can never refresh itself, then it should always return false.
-
delete
-
delete
public boolean delete(boolean keepReferences) Delete code/label symbol- Parameters:
keepReferences- if false all references to this symbols address will be removed, otherwise associated references will simply be disassociated following symbol removal (seeSymbolManager.doRemoveSymbol(SymbolDB).- Returns:
- true if symbol successfully removed
-
getObject
- Returns:
- object associated with this symbol or null if symbol has been deleted
-
isPrimary
-
setPrimary
public boolean setPrimary()Description copied from interface:SymbolSets this symbol to be primary. All other symbols at the same address will be set to !primary. Only applies to non-function symbols.- Specified by:
setPrimaryin interfaceSymbol- Overrides:
setPrimaryin classSymbolDB- Returns:
- returns true if the symbol was not primary and now it is, otherwise false
- See Also:
-
getProgramLocation
Description 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
-
isValidParent
Description 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 interfaceSymbol- Overrides:
isValidParentin classSymbolDB- Parameters:
parent- prospective parent namespace for this symbol- Returns:
- true if parent is valid
-
doGetName
-
validateNameSource
Description copied from class:SymbolDBAllow symbol implementations to validate the source when setting the name of this symbol- Overrides:
validateNameSourcein classSymbolDB- Parameters:
newName- the new namesource- the source type- Returns:
- the validated source type
-