Enum Class DBTraceUtils

java.lang.Object
java.lang.Enum<DBTraceUtils>
ghidra.trace.database.DBTraceUtils
All Implemented Interfaces:
Serializable, Comparable<DBTraceUtils>, Constable

public enum DBTraceUtils extends Enum<DBTraceUtils>
Various utilities used for implementing the trace database

Some of these are also useful from the API perspective. TODO: We should probably separate trace API utilities into another class.

  • Method Details

    • values

      public static DBTraceUtils[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DBTraceUtils valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • tableName

      public static String tableName(String baseName, AddressSpace space)
      Derive the table name for a given addres/register space
      Parameters:
      baseName - the base name of the table group
      space - the address space
      Returns:
      the table name
    • makeWay

      public static <DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<?>> void makeWay(DR data, Lifespan span, BiConsumer<? super DR,Lifespan> lifespanSetter, Consumer<? super DR> deleter)
      Truncate or delete an entry to make room

      Only call this method for entries which definitely intersect the given span. This does not verify intersection. If the data's start snap is contained in the span to clear, the entry is deleted. Otherwise, it's end snap is set to one less than the span's start snap.

      Parameters:
      data - the entry subject to truncation or deletion
      span - the span to clear up
      lifespanSetter - the method used to truncate the entry
      deleter - the method used to delete the entry
    • covariantIterator

      public static <T> Iterator<T> covariantIterator(Iterator<? extends T> it)
      Cast an iterator to a less-specific type, given that it cannot insert elements
      Type Parameters:
      T - the desired type
      Parameters:
      it - the iterator of more specific type
      Returns:
      the same iterator
    • getAddressSet

      public static AddressSetView getAddressSet(AddressFactory factory, Address start, boolean forward)
      Get all the addresses in a factory, starting at the given place

      If backward, this yields all addresses coming before start

      Parameters:
      factory - the factory
      start - the start (or end) address
      forward - true for all after, false for all before
      Returns:
      the address set
    • toRange

      public static AddressRange toRange(Address min, Address max)
      Create an address range, checking the endpoints
      Parameters:
      min - the min address, which must be less than or equal to max
      max - the max address, which must be greater than or equal to min
      Returns:
      the range
      Throws:
      IllegalArgumentException - if max is less than min