Package ghidra.program.database.symbol
Class LibrarySymbol
- java.lang.Object
-
- ghidra.program.database.DatabaseObject
-
- ghidra.program.database.symbol.SymbolDB
-
- ghidra.program.database.symbol.LibrarySymbol
-
-
Constructor Summary
Constructors Constructor Description LibrarySymbol(SymbolManager symbolMgr, DBObjectCache<SymbolDB> cache, Address address, DBRecord record)Constructs a new Library Symbol
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetObject()ProgramLocationgetProgramLocation()SymbolTypegetSymbolType()Returns this symbol's typebooleanisExternal()Returns true if this an external symbol.booleanisPrimary()booleanisValidParent(Namespace parent)Determines if 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.voidsetSymbolStringData(java.lang.String newPath)Sets the symbol's string data field.-
Methods inherited from class ghidra.program.database.symbol.SymbolDB
checkDeleted, delete, doCheckIsPrimary, doGetName, doGetParentNamespace, doIsPinned, doSetNameAndNamespace, doSetPinned, doSetPrimary, equals, getAddress, getDataTypeId, getID, getName, getName, getParentNamespace, getParentSymbol, getPath, getProgram, getReferenceCount, getReferences, getReferences, getSource, getSymbolsDynamicallyRenamedByMyRename, getSymbolStringData, getVariableOffset, hashCode, hasMultipleReferences, hasReferences, isDeleted, isDeleting, isDescendant, isDynamic, isExternalEntryPoint, isGlobal, isPinned, moveLowLevel, refresh, refresh, setAddress, setDataTypeId, setNamespace, setPinned, setPrimary, setSource, setVariableOffset, toString, validateNameSource
-
Methods inherited from class ghidra.program.database.DatabaseObject
checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setInvalid, validate
-
-
-
-
Constructor Detail
-
LibrarySymbol
public LibrarySymbol(SymbolManager symbolMgr, DBObjectCache<SymbolDB> cache, Address address, DBRecord record)
Constructs a new Library Symbol- Parameters:
symbolMgr- the symbol managercache- symbol object cacheaddress- the address for this symbolrecord- the record for this symbol
-
-
Method Detail
-
setName
public void setName(java.lang.String newName, SourceType source) throws DuplicateNameException, InvalidInputExceptionDescription copied from interface:SymbolSets the name this symbol. If this symbol is dynamic, then the name is set and the symbol is no longer dynamic.- Specified by:
setNamein interfaceSymbol- Overrides:
setNamein classSymbolDB- 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
-
setNameAndNamespace
public void setNameAndNamespace(java.lang.String newName, Namespace newNamespace, SourceType source) throws DuplicateNameException, InvalidInputException, CircularDependencyExceptionDescription 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 interfaceSymbol- Overrides:
setNameAndNamespacein 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
-
setSymbolStringData
public void setSymbolStringData(java.lang.String newPath)
Description copied from class:SymbolDBSets the symbol's string data field. This field's data has different uses depending on the symbol type and whether or not it is external.- Overrides:
setSymbolStringDatain classSymbolDB- Parameters:
newPath- the string to store in the string data field
-
getSymbolType
public SymbolType getSymbolType()
Description copied from interface:SymbolReturns this symbol's type- Returns:
- symbol type
-
isExternal
public boolean isExternal()
Description copied from interface:SymbolReturns true if this an external symbol.- Returns:
- true if this an external symbol.
- See Also:
Address.isExternalAddress()
-
getObject
public java.lang.Object getObject()
- Returns:
- object associated with this symbol or null if symbol has been deleted
-
isPrimary
public boolean isPrimary()
-
getProgramLocation
public ProgramLocation getProgramLocation()
- Returns:
- a program location corresponding to this symbol
- See Also:
Symbol.getProgramLocation()
-
isValidParent
public boolean isValidParent(Namespace parent)
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- Specified by:
isValidParentin classSymbolDB- Parameters:
parent- prospective parent namespace for this symbol- Returns:
- true if parent is valid
-
-