Interface TraceSymbol
- All Superinterfaces:
Symbol
- All Known Subinterfaces:
TraceClassSymbol,TraceLabelSymbol,TraceNamespaceSymbol,TraceSymbolWithLifespan
- All Known Implementing Classes:
AbstractDBTraceSymbol,DBTraceClassSymbol,DBTraceLabelSymbol,DBTraceNamespaceSymbol
This is essentially the equivalent concept of Symbol from a Program. One
important distinction is that in the trace implementation, the symbol and the object it describes
are the same. For example, in a Program, a Namespace and its symbol are two
different things. To get the namespace, you would invoke Symbol.getObject(). That is
unnecessary, though permissible, with a trace, because TraceNamespaceSymbol extends from
both Namespace and Symbol.
-
Method Summary
Modifier and TypeMethodDescriptionReturn the parent namespace for this symbol.Returns namespace symbol of the namespace containing this symbolCollection<? extends TraceReference> Get all memory references to the address of this symbol.Returns all memory references to the address of this symbol.getReferences(TaskMonitor monitor) Returns all memory references to the address of this symbol.If in register space, get the thread associated with this symbol.getTrace()Get the trace to which this symbol belongs.booleanisPinned()Returns true if the symbol is pinned to its current address.voidsetPinned(boolean pinned) Sets whether or not this symbol is pinned to its associated address.Methods inherited from interface ghidra.program.model.symbol.Symbol
delete, getAddress, getID, getName, getName, getObject, getPath, getProgram, getProgramLocation, getReferenceCount, getSource, getSymbolType, hasReferences, isDeleted, isDescendant, isDynamic, isExternal, isExternalEntryPoint, isGlobal, isPrimary, isValidParent, setName, setNameAndNamespace, setNamespace, setPrimary, setSource
-
Method Details
-
getTrace
Trace getTrace()Get the trace to which this symbol belongs.- Returns:
- the trace
-
getThread
TraceThread getThread()If in register space, get the thread associated with this symbol.- Returns:
- the thread
-
getParentNamespace
TraceNamespaceSymbol getParentNamespace()Description copied from interface:SymbolReturn the parent namespace for this symbol.- Specified by:
getParentNamespacein interfaceSymbol- Returns:
- the namespace that contains this symbol.
-
getParentSymbol
TraceNamespaceSymbol getParentSymbol()Description copied from interface:SymbolReturns namespace symbol of the namespace containing this symbol- Specified by:
getParentSymbolin interfaceSymbol- Returns:
- parent namespace symbol
-
getReferences
Returns all memory references to the address of this symbol. If you do not have aTaskMonitorinstance, then you can passTaskMonitor.DUMMYornull. For traces,getReferenceCollection()is preferred, as it will retrieve the references lazily.- Specified by:
getReferencesin interfaceSymbol- Parameters:
monitor- the monitor that is used to report progress and to cancel this potentially long-running call- Returns:
- all memory references to the address of this symbol.
-
getReferenceCollection
Collection<? extends TraceReference> getReferenceCollection()Get all memory references to the address of this symbol.- Returns:
- the references
-
getReferences
TraceReference[] getReferences()Returns all memory references to the address of this symbol. For traces,getReferenceCollection()is preferred, as it will retrieve the references lazily.- Specified by:
getReferencesin interfaceSymbol- Returns:
- all memory references to the address of this symbol
- See Also:
-
setPinned
void setPinned(boolean pinned) 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.
Traces do not support moving memory, so pinning is meaningless and unsupported. -
isPinned
boolean isPinned()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. Traces do not support moving memory, so pinning is meaningless and unsupported.
-