Package ghidra.trace.database.guest

# Class DBTracePlatformManager

java.lang.Object
ghidra.trace.database.guest.DBTracePlatformManager

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

public class DBTracePlatformManager extends Object implements DBTraceManager, TracePlatformManager

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `class`
  `DBTracePlatformManager.DBTraceHostPlatform`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final CompilerSpec`
  `baseCompilerSpec`
  `protected final Language`
  `baseLanguage`
  `protected final DBHandle`
  `dbh`
  `protected final InternalTracePlatform`
  `hostPlatform`
  `protected final Map<Language,DBTraceGuestPlatform.DBTraceGuestLanguage>`
  `languagesByLanguage`
  `protected final DBCachedObjectStore<DBTraceGuestPlatform.DBTraceGuestLanguage>`
  `languageStore`
  `protected final ReadWriteLock`
  `lock`
  `protected final Map<CompilerSpec,DBTraceGuestPlatform>`
  `platformsByCompiler`
  `protected final DBCachedObjectStore<DBTraceGuestPlatform>`
  `platformStore`
  `protected final Collection<TraceGuestPlatform>`
  `platformView`
  `protected final DBCachedObjectStore<DBTraceGuestPlatformMappedRange>`
  `rangeMappingStore`
  `protected final DBTrace`
  `trace`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTracePlatformManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, CompilerSpec baseCompilerSpec, DBTrace trace)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DBTraceGuestPlatform`
  `addGuestPlatform(CompilerSpec compilerSpec)`
  Add a guest platform
  `InternalTracePlatform`
  `assertMine(TracePlatform platform)`
  `protected Address`
  `computeNextRegisterMin()`
  `void`
  `dbError(IOException e)`
  Notification that an IO exception occurred.
  `protected void`
  `deleteGuestPlatform(DBTraceGuestPlatform platform, TaskMonitor monitor)`
  `protected DBTraceGuestPlatform`
  `doAddGuestPlatform(CompilerSpec compilerSpec)`
  `protected CompilerSpec`
  `getCompilerByKey(int compilerKey)`
  `Collection<TraceGuestPlatform>`
  `getGuestPlatforms()`
  Get all guest platforms
  `InternalTracePlatform`
  `getHostPlatform()`
  Get a platform representing the trace's base language and compiler spec
  `DBTraceGuestPlatform.DBTraceGuestLanguage`
  `getLanguageByKey(int key)`
  `DBTraceGuestPlatform.DBTraceGuestLanguage`
  `getLanguageByLanguage(Language language)`
  `InternalTracePlatform`
  `getOrAddPlatform(CompilerSpec compilerSpec)`
  Get or add a platform for the given compiler spec
  `protected DBTraceGuestPlatform.DBTraceGuestLanguage`
  `getOrCreateLanguage(Language language)`
  `InternalTracePlatform`
  `getPlatform(CompilerSpec compilerSpec)`
  Get the platform for the given compiler spec
  `InternalTracePlatform`
  `getPlatformByKey(int key)`
  `protected int`
  `getPlatformKeyForCompiler(CompilerSpec compiler)`
  `void`
  `invalidateCache(boolean all)`
  Invalidate this manager's caches
  `protected void`
  `loadLanguages()`
  `protected void`
  `loadPlatformMappings()`
  `protected void`
  `loadPlatforms(OpenMode openMode, TaskMonitor monitor)`

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

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

- ## Field Details

  - ### dbh

    protected final DBHandle dbh

  - ### lock

    protected final ReadWriteLock lock

  - ### baseLanguage

    protected final Language baseLanguage

  - ### baseCompilerSpec

    protected final CompilerSpec baseCompilerSpec

  - ### trace

    protected final DBTrace trace

  - ### languageStore

    protected final DBCachedObjectStore<DBTraceGuestPlatform.DBTraceGuestLanguage> languageStore

  - ### platformStore

    protected final DBCachedObjectStore<DBTraceGuestPlatform> platformStore

  - ### platformView

    protected final Collection<TraceGuestPlatform> platformView

  - ### languagesByLanguage

    protected final Map<Language,DBTraceGuestPlatform.DBTraceGuestLanguage> languagesByLanguage

  - ### platformsByCompiler

    protected final Map<CompilerSpec,DBTraceGuestPlatform> platformsByCompiler

  - ### rangeMappingStore

    protected final DBCachedObjectStore<DBTraceGuestPlatformMappedRange> rangeMappingStore

  - ### hostPlatform

    protected final InternalTracePlatform hostPlatform

- ## Constructor Details

  - ### DBTracePlatformManager

    public DBTracePlatformManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, CompilerSpec baseCompilerSpec, DBTrace trace) throws VersionException, IOException, CancelledException
    Throws:
      `VersionException`
      `IOException`
      `CancelledException`

- ## Method Details

  - ### loadLanguages

    protected void loadLanguages()

  - ### loadPlatforms

    protected void loadPlatforms(OpenMode openMode, TaskMonitor monitor) throws VersionException, CancelledException, IOException
    Throws:
      `VersionException`
      `CancelledException`
      `IOException`

  - ### loadPlatformMappings

    protected void loadPlatformMappings()

  - ### getOrCreateLanguage

    protected DBTraceGuestPlatform.DBTraceGuestLanguage getOrCreateLanguage(Language language)

  - ### getLanguageByKey

    public DBTraceGuestPlatform.DBTraceGuestLanguage getLanguageByKey(int key)

  - ### getPlatformByKey

    public InternalTracePlatform getPlatformByKey(int key)

  - ### getPlatformKeyForCompiler

    protected int getPlatformKeyForCompiler(CompilerSpec compiler)

  - ### getLanguageByLanguage

    public DBTraceGuestPlatform.DBTraceGuestLanguage getLanguageByLanguage(Language language)

  - ### getCompilerByKey

    protected CompilerSpec getCompilerByKey(int compilerKey)

  - ### 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)`.

  - ### deleteGuestPlatform

    protected void deleteGuestPlatform(DBTraceGuestPlatform platform, TaskMonitor monitor) throws CancelledException
    Throws:
      `CancelledException`

  - ### getHostPlatform

    public InternalTracePlatform getHostPlatform()
    Description copied from interface: `TracePlatformManager`
    Get a platform representing the trace's base language and compiler spec
    Specified by:
      `getHostPlatform` in interface `TracePlatformManager`
    Returns:
      the host platform

  - ### doAddGuestPlatform

    protected DBTraceGuestPlatform doAddGuestPlatform(CompilerSpec compilerSpec)

  - ### addGuestPlatform

    public DBTraceGuestPlatform addGuestPlatform(CompilerSpec compilerSpec)
    Description copied from interface: `TracePlatformManager`
    Add a guest platform
    Specified by:
      `addGuestPlatform` in interface `TracePlatformManager`
    Parameters:
      `compilerSpec` - the compiler spec, which cannot be the base compiler spec
    Returns:
      the new platform

  - ### getPlatform

    public InternalTracePlatform getPlatform(CompilerSpec compilerSpec)
    Description copied from interface: `TracePlatformManager`
    Get the platform for the given compiler spec
    Specified by:
      `getPlatform` in interface `TracePlatformManager`
    Parameters:
      `compilerSpec` - the compiler spec
    Returns:
      the platform, if found, or null

  - ### getOrAddPlatform

    public InternalTracePlatform getOrAddPlatform(CompilerSpec compilerSpec)
    Description copied from interface: `TracePlatformManager`
    Get or add a platform for the given compiler spec
    Specified by:
      `getOrAddPlatform` in interface `TracePlatformManager`
    Parameters:
      `compilerSpec` - the compiler spec
    Returns:
      the new or existing platform

  - ### getGuestPlatforms

    public Collection<TraceGuestPlatform> getGuestPlatforms()
    Description copied from interface: `TracePlatformManager`
    Get all guest platforms
    Specified by:
      `getGuestPlatforms` in interface `TracePlatformManager`
    Returns:
      the collection of platforms

  - ### assertMine

    public InternalTracePlatform assertMine(TracePlatform platform)

  - ### computeNextRegisterMin

    protected Address computeNextRegisterMin()