Package ghidra.trace.database.symbol
Class DBTraceSymbolManager
java.lang.Object
ghidra.trace.database.symbol.DBTraceSymbolManager
- All Implemented Interfaces:
ErrorHandler,DBTraceManager,TraceSymbolManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DBTraceSymbolMultipleTypesView<? extends DBTraceNamespaceSymbol> protected final DBTraceSymbolMultipleTypesView<?> protected final DBTraceClassSymbolViewprotected final DBCachedObjectStore<DBTraceClassSymbol> protected final DBTraceDataTypeManagerprotected final DBTraceNamespaceSymbolprotected final DBTraceLabelSymbolViewprotected final DBCachedObjectStore<DBTraceLabelSymbol> protected final ReadWriteLockprotected final DBTraceNamespaceSymbolViewprotected final DBCachedObjectStore<DBTraceNamespaceSymbol> protected final DBTraceSymbolMultipleTypesNoDuplicatesView<?> protected final DBTraceOverlaySpaceAdapterprotected final DBCachedObjectIndex<VariableStorage, DBTraceSymbolManager.DBTraceVariableStorageEntry> protected final DBCachedObjectStore<DBTraceSymbolManager.DBTraceVariableStorageEntry> protected final Map<Byte, AbstractDBTraceSymbolSingleTypeView<?>> protected final DBTraceThreadManagerprotected final DBTraceprotected final DBTraceSymbolMultipleTypesNoDuplicatesView<? extends DBTraceNamespaceSymbol> Fields inherited from interface ghidra.trace.model.symbol.TraceSymbolManager
PRIMALITY_COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionDBTraceSymbolManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager, DBTraceDataTypeManager dataTypeManager, DBTraceOverlaySpaceAdapter overlayAdapter) -
Method Summary
Modifier and TypeMethodDescriptionTraceSymbolView<? extends DBTraceNamespaceSymbol> Get a view of all the namespaces (including classes) in the trace.TraceSymbolView<? extends AbstractDBTraceSymbol> Get a view of all symbols in the trace.assertIsMine(Symbol symbol) protected voidassertNotDuplicate(AbstractDBTraceSymbol exclude, Lifespan lifespan, Address address, String name, DBTraceNamespaceSymbol parent) protected voidassertNotDuplicate(AbstractDBTraceSymbol exclude, String name, DBTraceNamespaceSymbol parent) protected voidassertUniqueName(String name, DBTraceNamespaceSymbol parent) Checks for duplicate names, allowingSymbolType.LABELprotected static voidassertValidName(String name) protected voidassertValidThreadAddress(TraceThread thread, Address address) protected DataTypecheckIndirection(VariableStorage s, DataType formal) checkIsMine(Namespace ns) checkIsMine(Symbol symbol) classes()Get a view of the classes in the trace.voidNotification that an IO exception occurred.protected voiddelID(TraceThread thread, AddressSpace addressSpace, long id) protected booleandoDeleteSymbol(AbstractDBTraceSymbol symbol) protected intGet the trace's global namespace.getIDsAdded(long from, long to) Get the set of unique symbol IDs that are added going from one snapshot to another.getIDsRemoved(long from, long to) Get the set of unique symbol IDs that are removed going from one snapshot to another.protected DBTraceNamespaceSymbolgetSymbolByID(long symbolID) Get a symbol by its unique identifier.getTrace()Get the trace for this manager.voidinvalidateCache(boolean all) Invalidate this manager's cacheslabels()Get a view of the labels in the trace.Get a view of the namespaces in the trace.TraceSymbolNoDuplicatesView<? extends AbstractDBTraceSymbol> Get a view of all the symbols except labels in the trace.protected static longpackID(byte typeID, long key) protected voidprotected voidputID(Lifespan lifespan, TraceThread thread, AddressRange rng, long id) protected <T extends AbstractDBTraceSymbolSingleTypeView<?>>
TputInMap(T view) voidreplaceDataTypes(Map<Long, Long> dataTypeReplacementMap) protected static longunpackKey(long symbolID) protected static byteunpackTypeID(long symbolID)
-
Field Details
-
trace
-
lock
-
threadManager
-
dataTypeManager
-
overlayAdapter
-
idMap
protected final DBTraceAddressSnapRangePropertyMap<Long,DBTraceSymbolManager.DBTraceSymbolIDEntry> idMap -
storageStore
-
storageByStorage
protected final DBCachedObjectIndex<VariableStorage,DBTraceSymbolManager.DBTraceVariableStorageEntry> storageByStorage -
labelStore
-
namespaceStore
-
classStore
-
globalNamespace
-
labels
-
namespaces
-
classes
-
allNamespaces
-
uniqueNamespaces
protected final DBTraceSymbolMultipleTypesNoDuplicatesView<? extends DBTraceNamespaceSymbol> uniqueNamespaces -
notLabels
-
allSymbols
-
symbolViews
-
-
Constructor Details
-
DBTraceSymbolManager
public DBTraceSymbolManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager, DBTraceDataTypeManager dataTypeManager, DBTraceOverlaySpaceAdapter overlayAdapter) throws VersionException, IOException - Throws:
VersionExceptionIOException
-
-
Method Details
-
checkIndirection
-
putInMap
-
getOrCreateGlobalNamespace
-
packID
protected static long packID(byte typeID, long key) -
unpackTypeID
protected static byte unpackTypeID(long symbolID) -
unpackKey
protected static long unpackKey(long symbolID) -
findOrRecordVariableStorage
-
dbError
Description copied from interface:ErrorHandlerNotification that an IO exception occurred.- Specified by:
dbErrorin interfaceErrorHandler- Parameters:
e-IOExceptionwhich was cause of error
-
invalidateCache
public void invalidateCache(boolean all) Description copied from interface:DBTraceManagerInvalidate this manager's caches- Specified by:
invalidateCachein interfaceDBTraceManager- Parameters:
all- probably nothing. Check out implementations ofManagerDB.invalidateCache(boolean).
-
replaceDataTypes
-
assertValidThreadAddress
-
getTrace
Description copied from interface:TraceSymbolManagerGet the trace for this manager.- Specified by:
getTracein interfaceTraceSymbolManager- Returns:
- the trace
-
getSymbolByID
Description copied from interface:TraceSymbolManagerGet a symbol by its unique identifier.The identifier is only unique within this trace.
- Specified by:
getSymbolByIDin interfaceTraceSymbolManager- Parameters:
symbolID- the id- Returns:
- the symbol, or null
-
getGlobalNamespace
Description copied from interface:TraceSymbolManagerGet the trace's global namespace.- Specified by:
getGlobalNamespacein interfaceTraceSymbolManager- Returns:
- the global namespace
-
labels
Description copied from interface:TraceSymbolManagerGet a view of the labels in the trace.- Specified by:
labelsin interfaceTraceSymbolManager- Returns:
- the labels view
-
namespaces
Description copied from interface:TraceSymbolManagerGet a view of the namespaces in the trace.- Specified by:
namespacesin interfaceTraceSymbolManager- Returns:
- the namespaces view
-
classes
Description copied from interface:TraceSymbolManagerGet a view of the classes in the trace.- Specified by:
classesin interfaceTraceSymbolManager- Returns:
- the classes view
-
allNamespaces
Description copied from interface:TraceSymbolManagerGet a view of all the namespaces (including classes) in the trace.- Specified by:
allNamespacesin interfaceTraceSymbolManager- Returns:
- the all-namespaces view
-
uniqueNamespaces
-
notLabels
Description copied from interface:TraceSymbolManagerGet a view of all the symbols except labels in the trace.NOTE: This method is somewhat vestigial. At one point, functions were partially implemented, so this would have contained functions, variables, etc. As the manager now only supports labels, namespaces, and classes, this is essentially the same as
TraceSymbolManager.allNamespaces().- Specified by:
notLabelsin interfaceTraceSymbolManager- Returns:
- the not-labels view
-
allSymbols
Description copied from interface:TraceSymbolManagerGet a view of all symbols in the trace.- Specified by:
allSymbolsin interfaceTraceSymbolManager- Returns:
- the all-symbols view
-
checkIsMine
-
checkIsMine
-
assertIsMine
-
assertIsMine
-
assertValidName
- Throws:
InvalidInputException
-
assertUniqueName
protected void assertUniqueName(String name, DBTraceNamespaceSymbol parent) throws DuplicateNameException Checks for duplicate names, allowingSymbolType.LABEL- Parameters:
name- the proposed nameparent- the parent namespace- Throws:
DuplicateNameException- if the name is a duplicate
-
doDeleteSymbol
-
putID
-
putID
-
delID
-
assertNotDuplicate
protected void assertNotDuplicate(AbstractDBTraceSymbol exclude, Lifespan lifespan, Address address, String name, DBTraceNamespaceSymbol parent) throws DuplicateNameException - Throws:
DuplicateNameException
-
assertNotDuplicate
protected void assertNotDuplicate(AbstractDBTraceSymbol exclude, String name, DBTraceNamespaceSymbol parent) throws DuplicateNameException - Throws:
DuplicateNameException
-
getIDsAdded
Description copied from interface:TraceSymbolManagerGet the set of unique symbol IDs that are added going from one snapshot to another.- Specified by:
getIDsAddedin interfaceTraceSymbolManager- Parameters:
from- the first snapshot keyto- the second snapshot key- Returns:
- the set of IDs absent in the first but present in the second
-
getIDsRemoved
Description copied from interface:TraceSymbolManagerGet the set of unique symbol IDs that are removed going from one snapshot to another.- Specified by:
getIDsRemovedin interfaceTraceSymbolManager- Parameters:
from- the first snapshot keyto- the second snapshot key- Returns:
- the set of IDs present in the first but absent in the second
-