Package ghidra.trace.database.symbol

# Class DBTraceSymbolManager

java.lang.Object
ghidra.trace.database.symbol.DBTraceSymbolManager

All Implemented Interfaces:
  `ErrorHandler`, `DBTraceManager`, `TraceSymbolManager`

public class DBTraceSymbolManager extends Object implements TraceSymbolManager, DBTraceManager

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `DBTraceSymbolManager.DBTraceSymbolIDEntry`
  `static class`
  `DBTraceSymbolManager.DBTraceVariableStorageEntry`
  `static enum`
  `DBTraceSymbolManager.MySymbolTypes`
  `static class`
  `DBTraceSymbolManager.VariableStorageDBFieldCodec`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final DBTraceSymbolMultipleTypesView<? extends DBTraceNamespaceSymbol>`
  `allNamespaces`
  `protected final DBTraceSymbolMultipleTypesView<?>`
  `allSymbols`
  `protected final DBTraceClassSymbolView`
  `classes`
  `protected final DBCachedObjectStore<DBTraceClassSymbol>`
  `classStore`
  `protected final DBTraceDataTypeManager`
  `dataTypeManager`
  `protected final DBTraceNamespaceSymbol`
  `globalNamespace`
  `protected final DBTraceAddressSnapRangePropertyMap<Long,DBTraceSymbolManager.DBTraceSymbolIDEntry>`
  `idMap`
  `protected final DBTraceLabelSymbolView`
  `labels`
  `protected final DBCachedObjectStore<DBTraceLabelSymbol>`
  `labelStore`
  `protected final ReadWriteLock`
  `lock`
  `protected final DBTraceNamespaceSymbolView`
  `namespaces`
  `protected final DBCachedObjectStore<DBTraceNamespaceSymbol>`
  `namespaceStore`
  `protected final DBTraceSymbolMultipleTypesNoDuplicatesView<?>`
  `notLabels`
  `protected final DBTraceOverlaySpaceAdapter`
  `overlayAdapter`
  `protected final DBCachedObjectIndex<VariableStorage,DBTraceSymbolManager.DBTraceVariableStorageEntry>`
  `storageByStorage`
  `protected final DBCachedObjectStore<DBTraceSymbolManager.DBTraceVariableStorageEntry>`
  `storageStore`
  `protected final Map<Byte,AbstractDBTraceSymbolSingleTypeView<?>>`
  `symbolViews`
  `protected final DBTraceThreadManager`
  `threadManager`
  `protected final DBTrace`
  `trace`
  `protected final DBTraceSymbolMultipleTypesNoDuplicatesView<? extends DBTraceNamespaceSymbol>`
  `uniqueNamespaces`

  ### Fields inherited from interface ghidra.trace.model.symbol.TraceSymbolManager

  `PRIMALITY_COMPARATOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTraceSymbolManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager, DBTraceDataTypeManager dataTypeManager, DBTraceOverlaySpaceAdapter overlayAdapter)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TraceSymbolView<? extends DBTraceNamespaceSymbol>`
  `allNamespaces()`
  Get a view of all the namespaces (including classes) in the trace.
  `TraceSymbolView<? extends AbstractDBTraceSymbol>`
  `allSymbols()`
  Get a view of all symbols in the trace.
  `DBTraceNamespaceSymbol`
  `assertIsMine(Namespace ns)`
  `AbstractDBTraceSymbol`
  `assertIsMine(Symbol symbol)`
  `protected void`
  `assertNotDuplicate(AbstractDBTraceSymbol exclude, Lifespan lifespan, Address address, String name, DBTraceNamespaceSymbol parent)`
  `protected void`
  `assertNotDuplicate(AbstractDBTraceSymbol exclude, String name, DBTraceNamespaceSymbol parent)`
  `protected void`
  `assertUniqueName(String name, DBTraceNamespaceSymbol parent)`
  Checks for duplicate names, allowing `SymbolType.LABEL`
  `protected static void`
  `assertValidName(String name)`
  `protected void`
  `assertValidThreadAddress(TraceThread thread, Address address)`
  `protected DataType`
  `checkIndirection(VariableStorage s, DataType formal)`
  `DBTraceNamespaceSymbol`
  `checkIsMine(Namespace ns)`
  `AbstractDBTraceSymbol`
  `checkIsMine(Symbol symbol)`
  `DBTraceClassSymbolView`
  `classes()`
  Get a view of the classes in the trace.
  `void`
  `dbError(IOException e)`
  Notification that an IO exception occurred.
  `protected void`
  `delID(TraceThread thread, AddressSpace addressSpace, long id)`
  `protected boolean`
  `doDeleteSymbol(AbstractDBTraceSymbol symbol)`
  `protected int`
  `findOrRecordVariableStorage(VariableStorage storage)`
  `DBTraceNamespaceSymbol`
  `getGlobalNamespace()`
  Get the trace's global namespace.
  `Collection<Long>`
  `getIDsAdded(long from, long to)`
  Get the set of unique symbol IDs that are added going from one snapshot to another.
  `Collection<Long>`
  `getIDsRemoved(long from, long to)`
  Get the set of unique symbol IDs that are removed going from one snapshot to another.
  `protected DBTraceNamespaceSymbol`
  `getOrCreateGlobalNamespace()`
  `AbstractDBTraceSymbol`
  `getSymbolByID(long symbolID)`
  Get a symbol by its unique identifier.
  `Trace`
  `getTrace()`
  Get the trace for this manager.
  `void`
  `invalidateCache(boolean all)`
  Invalidate this manager's caches
  `DBTraceLabelSymbolView`
  `labels()`
  Get a view of the labels in the trace.
  `DBTraceNamespaceSymbolView`
  `namespaces()`
  Get a view of the namespaces in the trace.
  `TraceSymbolNoDuplicatesView<? extends AbstractDBTraceSymbol>`
  `notLabels()`
  Get a view of all the symbols except labels in the trace.
  `protected static long`
  `packID(byte typeID, long key)`
  `protected void`
  `putID(Lifespan lifespan, Address address, long id)`
  `protected void`
  `putID(Lifespan lifespan, TraceThread thread, AddressRange rng, long id)`
  `protected <T extends AbstractDBTraceSymbolSingleTypeView<?>>
  T`
  `putInMap(T view)`
  `void`
  `replaceDataTypes(Map<Long,Long> dataTypeReplacementMap)`
  `TraceSymbolNoDuplicatesView<? extends DBTraceNamespaceSymbol>`
  `uniqueNamespaces()`
  `protected static long`
  `unpackKey(long symbolID)`
  `protected static byte`
  `unpackTypeID(long symbolID)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### trace

    protected final DBTrace trace

  - ### lock

    protected final ReadWriteLock lock

  - ### threadManager

    protected final DBTraceThreadManager threadManager

  - ### dataTypeManager

    protected final DBTraceDataTypeManager dataTypeManager

  - ### overlayAdapter

    protected final DBTraceOverlaySpaceAdapter overlayAdapter

  - ### idMap

    protected final DBTraceAddressSnapRangePropertyMap<Long,DBTraceSymbolManager.DBTraceSymbolIDEntry> idMap

  - ### storageStore

    protected final DBCachedObjectStore<DBTraceSymbolManager.DBTraceVariableStorageEntry> storageStore

  - ### storageByStorage

    protected final DBCachedObjectIndex<VariableStorage,DBTraceSymbolManager.DBTraceVariableStorageEntry> storageByStorage

  - ### labelStore

    protected final DBCachedObjectStore<DBTraceLabelSymbol> labelStore

  - ### namespaceStore

    protected final DBCachedObjectStore<DBTraceNamespaceSymbol> namespaceStore

  - ### classStore

    protected final DBCachedObjectStore<DBTraceClassSymbol> classStore

  - ### globalNamespace

    protected final DBTraceNamespaceSymbol globalNamespace

  - ### labels

    protected final DBTraceLabelSymbolView labels

  - ### namespaces

    protected final DBTraceNamespaceSymbolView namespaces

  - ### classes

    protected final DBTraceClassSymbolView classes

  - ### allNamespaces

    protected final DBTraceSymbolMultipleTypesView<? extends DBTraceNamespaceSymbol> allNamespaces

  - ### uniqueNamespaces

    protected final DBTraceSymbolMultipleTypesNoDuplicatesView<? extends DBTraceNamespaceSymbol> uniqueNamespaces

  - ### notLabels

    protected final DBTraceSymbolMultipleTypesNoDuplicatesView<?> notLabels

  - ### allSymbols

    protected final DBTraceSymbolMultipleTypesView<?> allSymbols

  - ### symbolViews

    protected final Map<Byte,AbstractDBTraceSymbolSingleTypeView<?>> 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:
      `VersionException`
      `IOException`

- ## Method Details

  - ### checkIndirection

    protected DataType checkIndirection(VariableStorage s, DataType formal)

  - ### putInMap

    protected <T extends AbstractDBTraceSymbolSingleTypeView<?>> T putInMap(T view)

  - ### getOrCreateGlobalNamespace

    protected DBTraceNamespaceSymbol 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

    protected int findOrRecordVariableStorage(VariableStorage storage)

  - ### dbError

    public void dbError(IOException e)
    Description copied from interface: `ErrorHandler`
    Notification that an IO exception occurred.
    Specified by:
      `dbError` in interface `ErrorHandler`
    Parameters:
      `e` - `IOException` which was cause of error

  - ### invalidateCache

    public void invalidateCache(boolean all)
    Description copied from interface: `DBTraceManager`
    Invalidate this manager's caches
    Specified by:
      `invalidateCache` in interface `DBTraceManager`
    Parameters:
      `all` - probably nothing. Check out implementations of `ManagerDB.invalidateCache(boolean)`.

  - ### replaceDataTypes

    public void replaceDataTypes(Map<Long,Long> dataTypeReplacementMap)

  - ### assertValidThreadAddress

    protected void assertValidThreadAddress(TraceThread thread, Address address)

  - ### getTrace

    public Trace getTrace()
    Description copied from interface: `TraceSymbolManager`
    Get the trace for this manager.
    Specified by:
      `getTrace` in interface `TraceSymbolManager`
    Returns:
      the trace

  - ### getSymbolByID

    public AbstractDBTraceSymbol getSymbolByID(long symbolID)
    Description copied from interface: `TraceSymbolManager`
    Get a symbol by its unique identifier.

    The identifier is only unique within this trace.

    Specified by:
      `getSymbolByID` in interface `TraceSymbolManager`
    Parameters:
      `symbolID` - the id
    Returns:
      the symbol, or null

  - ### getGlobalNamespace

    public DBTraceNamespaceSymbol getGlobalNamespace()
    Description copied from interface: `TraceSymbolManager`
    Get the trace's global namespace.
    Specified by:
      `getGlobalNamespace` in interface `TraceSymbolManager`
    Returns:
      the global namespace

  - ### labels

    public DBTraceLabelSymbolView labels()
    Description copied from interface: `TraceSymbolManager`
    Get a view of the labels in the trace.
    Specified by:
      `labels` in interface `TraceSymbolManager`
    Returns:
      the labels view

  - ### namespaces

    public DBTraceNamespaceSymbolView namespaces()
    Description copied from interface: `TraceSymbolManager`
    Get a view of the namespaces in the trace.
    Specified by:
      `namespaces` in interface `TraceSymbolManager`
    Returns:
      the namespaces view

  - ### classes

    public DBTraceClassSymbolView classes()
    Description copied from interface: `TraceSymbolManager`
    Get a view of the classes in the trace.
    Specified by:
      `classes` in interface `TraceSymbolManager`
    Returns:
      the classes view

  - ### allNamespaces

    public TraceSymbolView<? extends DBTraceNamespaceSymbol> allNamespaces()
    Description copied from interface: `TraceSymbolManager`
    Get a view of all the namespaces (including classes) in the trace.
    Specified by:
      `allNamespaces` in interface `TraceSymbolManager`
    Returns:
      the all-namespaces view

  - ### uniqueNamespaces

    public TraceSymbolNoDuplicatesView<? extends DBTraceNamespaceSymbol> uniqueNamespaces()

  - ### notLabels

    public TraceSymbolNoDuplicatesView<? extends AbstractDBTraceSymbol> notLabels()
    Description copied from interface: `TraceSymbolManager`
    Get 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:
      `notLabels` in interface `TraceSymbolManager`
    Returns:
      the not-labels view

  - ### allSymbols

    public TraceSymbolView<? extends AbstractDBTraceSymbol> allSymbols()
    Description copied from interface: `TraceSymbolManager`
    Get a view of all symbols in the trace.
    Specified by:
      `allSymbols` in interface `TraceSymbolManager`
    Returns:
      the all-symbols view

  - ### checkIsMine

    public DBTraceNamespaceSymbol checkIsMine(Namespace ns)

  - ### checkIsMine

    public AbstractDBTraceSymbol checkIsMine(Symbol symbol)

  - ### assertIsMine

    public DBTraceNamespaceSymbol assertIsMine(Namespace ns)

  - ### assertIsMine

    public AbstractDBTraceSymbol assertIsMine(Symbol symbol)

  - ### assertValidName

    protected static void assertValidName(String name) throws InvalidInputException
    Throws:
      `InvalidInputException`

  - ### assertUniqueName

    protected void assertUniqueName(String name, DBTraceNamespaceSymbol parent) throws DuplicateNameException
    Checks for duplicate names, allowing `SymbolType.LABEL`
    Parameters:
      `name` - the proposed name
      `parent` - the parent namespace
    Throws:
      `DuplicateNameException` - if the name is a duplicate

  - ### doDeleteSymbol

    protected boolean doDeleteSymbol(AbstractDBTraceSymbol symbol)

  - ### putID

    protected void putID(Lifespan lifespan, Address address, long id)

  - ### putID

    protected void putID(Lifespan lifespan, TraceThread thread, AddressRange rng, long id)

  - ### delID

    protected void delID(TraceThread thread, AddressSpace addressSpace, long id)

  - ### 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

    public Collection<Long> getIDsAdded(long from, long to)
    Description copied from interface: `TraceSymbolManager`
    Get the set of unique symbol IDs that are added going from one snapshot to another.
    Specified by:
      `getIDsAdded` in interface `TraceSymbolManager`
    Parameters:
      `from` - the first snapshot key
      `to` - the second snapshot key
    Returns:
      the set of IDs absent in the first but present in the second

  - ### getIDsRemoved

    public Collection<Long> getIDsRemoved(long from, long to)
    Description copied from interface: `TraceSymbolManager`
    Get the set of unique symbol IDs that are removed going from one snapshot to another.
    Specified by:
      `getIDsRemoved` in interface `TraceSymbolManager`
    Parameters:
      `from` - the first snapshot key
      `to` - the second snapshot key
    Returns:
      the set of IDs present in the first but absent in the second