Class LibrarySymbol
java.lang.Object
ghidra.program.database.DbObject
ghidra.program.database.symbol.SymbolDB
ghidra.program.database.symbol.LibrarySymbol
- All Implemented Interfaces:
Symbol, Comparable<LibrarySymbol>
Class for library symbols.
Symbol data usage:
String stringData - associated program project file path
-
Field Summary
-
Method Summary
ChangeModifier and TypeMethodDescriptionintbooleandelete()Delete the symbol and its associated resources.Returns the library program path within the project (may be null).intReturns Library's ordinal placement within ordered library list..Returns this symbol's typebooleanReturns true if this an external symbol.booleanbooleanisValidParent(Namespace parent) Determines if the given parent is valid for this Symbol.voidsetExternalLibraryPath(String libraryPath) Set the library program path within the project.voidsetNameAndNamespace(String newName, Namespace newNamespace, SourceType source) Sets the symbols name and namespace.voidsetOrdinal(int ordinal) Set the Library ordinal.static voidvalidateExternalPath(String path) Perform path validation for an external library path within the projectREMOVEDvoidsetName(String newName, SourceType source) RemovedMethods inherited from class SymbolDB
checkDeleted, doCheckIsPrimary, doGetName, doGetParentNamespace, doSetNameAndNamespace, doSetPrimary, equals, getAddress, getDataTypeId, getID, getName, getName, getParentNamespace, getParentSymbol, getPath, getProgram, getSource, getSymbolsDynamicallyRenamedByMyRename, hashCode, isDeleted, isDeleting, isDescendant, isDynamic, isGlobal, refresh, setAddress, setDataTypeId, setName, setNamespace, setPrimary, setSource, setSourceFlagBits, toString, updateRecord, validateNameSourceMethods inherited from class DbObject
getKey, isDeleted, isValid, keyChanged, needsRefreshing, refreshIfNeeded, setDeleted, setInvalid, setValid, validateMethods inherited from interface Symbol
getProgramLocation, getReferenceCount, getReferences, getReferences, hasReferences, isExternalEntryPoint, isPinned, setPinned
-
Method Details
-
setNameAndNamespace
public 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 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
-
delete NEW
-
getSymbolType
Description copied from interface:SymbolReturns this symbol's type- Specified by:
getSymbolTypein interfaceSymbol- Returns:
- symbol type
-
isExternal
public boolean isExternal()Description copied from interface:SymbolReturns true if this an external symbol.- Specified by:
isExternalin interfaceSymbol- Returns:
- true if this an external symbol.
- See Also:
-
getObject
-
isPrimary
-
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
-
getOrdinal NEW
public int getOrdinal()Returns Library's ordinal placement within ordered library list..- Returns:
- Library's ordinal placement within ordered library list.
-
setOrdinal NEW
public void setOrdinal(int ordinal) Set the Library ordinal. Other Library ordinals will be adjusted if displaced by ordinal change. No change is made if this Library symbol corresponds toLibrary.UNKNOWNLibrary.- Parameters:
ordinal- positive greater or equal to 0.- Throws:
IllegalArgumentException- if a negative ordinal is specified
-
getExternalLibraryPath
Returns the library program path within the project (may be null).- Returns:
- the library program path within the project (may be null)
-
setExternalLibraryPath MODIFIED
added throws InvalidInputException-void setExternalLibraryPath(java.lang.String libraryPath)+void setExternalLibraryPath(java.lang.String libraryPath) throws InvalidInputExceptionSet the library program path within the project. TheLibrary.UNKNOWNLibrary path may only be cleared.- Parameters:
libraryPath- library program path or null to clear- Throws:
InvalidInputException- if an invalid project file path is specified
-
validateExternalPath NEW
Perform path validation for an external library path within the project- Parameters:
path- external library path within the project (null is allowed for clearing path)- Throws:
InvalidInputException- if path is invalid
-
compareTo NEW
- Specified by:
compareToin interfaceComparable<LibrarySymbol>
-