Package ghidra.debug.api.action
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 Summary
Modifier and TypeMethodDescriptionbooleanaffectedByBytesChange(AddressSpace space, TraceAddressSnapRange range, DebuggerCoordinates coordinates) Check if the address should be recomputed given the indicated value changebooleanaffectedByStackChange(TraceStack stack, DebuggerCoordinates coordinates) Check if the address should be recomputed given the indicated stack changecomputeTraceAddress(ServiceProvider provider, DebuggerCoordinates coordinates) Compute the trace address to "goto"getDefaultGoToInput(ServiceProvider provider, DebuggerCoordinates coordinates, ProgramLocation location) Get the suggested input if the user activates "Go To" while this tracker is activebooleanIndicates whether the user should expect instructions at the tracked location.
-
Method Details
-
computeTraceAddress
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 thanDebuggerCoordinates.getSnap(). The address returned must be in the host platform's language, i.e., please useTracePlatform.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 coordinateslocation- 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 occurredrange- the range (time and space) where the change occurredcoordinates- the provider's current coordinates- Returns:
- true if re-computation and "goto" is warranted
-
affectedByStackChange
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
-