Package ghidra.program.model.symbol
Class SymbolType
java.lang.Object
ghidra.program.model.symbol.SymbolType
Class to represent the various types of Symbols.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SymbolType
static final SymbolType
Deprecated, for removal: This API element is subject to removal in a future version.static final SymbolType
static final SymbolType
static final SymbolType
static final SymbolType
static final SymbolType
static final SymbolType
static final SymbolType
static final SymbolType
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true of this symbol type allows duplicate names.boolean
byte
getID()
Returns the id of this symbol type.static SymbolType
getSymbolType
(int id) Returns the SymbolType for the given id.int
hashCode()
boolean
Returns true if this symbol represents a namespace.abstract boolean
isValidAddress
(Program program, Address symbolAddress) Returns true if the given address is valid for this symbol type.abstract boolean
isValidParent
(Program program, Namespace parent, Address symbolAddr, boolean isExternalSymbol) Returns true if the given namespace is a valid parent for a symbol of this type if it has the given address and whether or not it is external.abstract boolean
isValidSourceType
(SourceType sourceType, Address symbolAddress) Returns true if the given SourceType is valid for this symbol type.toString()
-
Field Details
-
LABEL
-
CODE
Deprecated, for removal: This API element is subject to removal in a future version.useLABEL
instead. -
LIBRARY
-
NAMESPACE
-
CLASS
-
FUNCTION
-
PARAMETER
-
LOCAL_VAR
-
GLOBAL_VAR
-
GLOBAL
-
-
Method Details
-
isValidParent
public abstract boolean isValidParent(Program program, Namespace parent, Address symbolAddr, boolean isExternalSymbol) Returns true if the given namespace is a valid parent for a symbol of this type if it has the given address and whether or not it is external.- Parameters:
program
- the program to contain the symbolparent
- the namespace where a symbol will potentially be parented.symbolAddr
- the address of they symbol to be parented.isExternalSymbol
- true if the symbol is external.- Returns:
- true if the given namespace is a valid parent for a symbol if it has the given address and whether or not it is external.
-
isValidAddress
Returns true if the given address is valid for this symbol type.- Parameters:
program
- the program to test for a valid address.symbolAddress
- the address of the symbol to be tested.- Returns:
- true if the given address is valid within the given program.
-
isValidSourceType
Returns true if the given SourceType is valid for this symbol type. (For example, Some symbols don't support the SymbolType.DEFAULT)- Parameters:
sourceType
- the sourceType to test.symbolAddress
- the address of the symbol to be tested.- Returns:
- true if the given SourceType is valid for this symbol type.
-
allowsDuplicates
public boolean allowsDuplicates()Returns true of this symbol type allows duplicate names.- Returns:
- true of this symbol type allows duplicate names.
-
isNamespace
public boolean isNamespace()Returns true if this symbol represents a namespace. -
toString
-
getID
public byte getID()Returns the id of this symbol type. -
getSymbolType
Returns the SymbolType for the given id.- Parameters:
id
- the id for the SymbolType to find.
-
hashCode
public int hashCode() -
equals
-
LABEL
instead.