Interface TraceSymbolManager

All Known Implementing Classes:
DBTraceSymbolManager

public interface TraceSymbolManager
The symbol table for traces.

Currently, functions are not supported, so effectively, the only symbol types possible in a trace are: labels, namespaces, and classes. Global variables are partially implemented, but as they are not finished, even in Program, they are not available in traces, either.

This manager supports a "fluid" API syntax. The methods on this manager narrow the scope in terms of the symbol type. Each returns a view, the methods of which operate on that type specifically. For example, to get the label at a specific address:

 trace.getSymbolManager().labels().getAt(0, null, addr, false);
 
  • Field Details

    • PRIMALITY_COMPARATOR

      static final Comparator<TraceSymbol> PRIMALITY_COMPARATOR
      A comparator that sorts primary symbols first.
  • Method Details

    • getTrace

      Trace getTrace()
      Get the trace for this manager.
      Returns:
      the trace
    • getSymbolByID

      TraceSymbol getSymbolByID(long symbolID)
      Get a symbol by its unique identifier.

      The identifier is only unique within this trace.

      Parameters:
      symbolID - the id
      Returns:
      the symbol, or null
    • getGlobalNamespace

      TraceNamespaceSymbol getGlobalNamespace()
      Get the trace's global namespace.
      Returns:
      the global namespace
    • labels

      Get a view of the labels in the trace.
      Returns:
      the labels view
    • namespaces

      Get a view of the namespaces in the trace.
      Returns:
      the namespaces view
    • classes

      Get a view of the classes in the trace.
      Returns:
      the classes view
    • allNamespaces

      TraceSymbolView<? extends TraceNamespaceSymbol> allNamespaces()
      Get a view of all the namespaces (including classes) in the trace.
      Returns:
      the all-namespaces view
    • notLabels

      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 allNamespaces().

      Returns:
      the not-labels view
    • allSymbols

      TraceSymbolView<? extends TraceSymbol> allSymbols()
      Get a view of all symbols in the trace.
      Returns:
      the all-symbols view
    • getIDsAdded

      Collection<Long> getIDsAdded(long from, long to)
      Get the set of unique symbol IDs that are added going from one snapshot to another.
      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

      Collection<Long> getIDsRemoved(long from, long to)
      Get the set of unique symbol IDs that are removed going from one snapshot to another.
      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