Interface LocationTracker


public interface LocationTracker
The actual tracking logic for a location tracking spec

In simple cases, the spec can implement this interface and return itself in LocationTrackingSpec.getTracker(). If the tracker needs some state, then the spec should create a separate tracker.

  • Method Details

    • computeTraceAddress

      Address computeTraceAddress(ServiceProvider provider, DebuggerCoordinates coordinates)
      Compute the trace address to "goto"

      If the coordinates indicate emulation, i.e., the schedule is non-empty, the trace manager will already have performed the emulation and stored the results in a "scratch" snap. In general, the location should be computed using that snap, i.e., DebuggerCoordinates.getViewSnap() rather than DebuggerCoordinates.getSnap(). The address returned must be in the host platform's language, i.e., please use TracePlatform.mapGuestToHost(Address).

      Parameters:
      provider - the service provider (usually the tool)
      coordinates - the trace, thread, snap, etc., of the tool
      Returns:
      the address to navigate to
    • getDefaultGoToInput

      GoToInput getDefaultGoToInput(ServiceProvider provider, DebuggerCoordinates coordinates, ProgramLocation location)
      Get the suggested input if the user activates "Go To" while this tracker is active
      Parameters:
      provider - the service provider (usually the tool)
      coordinates - the user's current coordinates
      location - the user's current location
      Returns:
      the suggested address or Sleigh expression
    • affectedByBytesChange

      boolean affectedByBytesChange(AddressSpace space, TraceAddressSnapRange range, DebuggerCoordinates coordinates)
      Check if the address should be recomputed given the indicated value change
      Parameters:
      space - the space (address space, thread, frame) where the change occurred
      range - the range (time and space) where the change occurred
      coordinates - the provider's current coordinates
      Returns:
      true if re-computation and "goto" is warranted
    • affectedByStackChange

      boolean affectedByStackChange(TraceStack stack, DebuggerCoordinates coordinates)
      Check if the address should be recomputed given the indicated stack change
      Parameters:
      stack - the stack that changed (usually it's PC / return offset)
      coordinates - the provider's current coordinates
      Returns:
      true if re-computation and "goto" is warranted
    • shouldDisassemble

      boolean shouldDisassemble()
      Indicates whether the user should expect instructions at the tracked location.

      Essentially, is this tracking the program counter?

      Returns:
      true to disassemble, false not to