Interface Step

All Superinterfaces:
Comparable<Step>
All Known Implementing Classes:
AbstractStep, PatchStep, SkipStep, TickStep

public interface Step extends Comparable<Step>
  • Method Details

    • parse

      static Step parse(String stepSpec, TraceSchedule.TimeRadix radix)
      Parse a step, possibly including a thread prefix, e.g., "t1-..."

      If the thread prefix is given, the step applies to the given thread. Otherwise, the step applies to the last thread or the event thread.

      Parameters:
      stepSpec - the string specification
      radix - the radix
      Returns:
      the parsed step
      Throws:
      IllegalArgumentException - if the specification is of the wrong form
    • parse

      static Step parse(long threadKey, String stepSpec, TraceSchedule.TimeRadix radix)
      Parse a step for the given thread key

      The form of the spec must either be numeric, indicating some number of ticks, or brace-enclosed Sleigh code, e.g., "{r0=0x1234}". The latter allows patching machine state during execution.

      Parameters:
      threadKey - the thread to step, or -1 for the last thread or event thread
      stepSpec - the string specification
      radix - the radix
      Returns:
      the parsed step
      Throws:
      IllegalArgumentException - if the specification is of the wrong form
    • nop

      static TickStep nop()
    • toString

    • getType

      Step.StepType getType()
    • getTypeOrder

      default int getTypeOrder()
    • isNop

      boolean isNop()
    • getThreadKey

      long getThreadKey()
    • isEventThread

      default boolean isEventThread()
    • requireThread

      static TraceThread requireThread(TraceThread thread, long key)
    • getThread

      default TraceThread getThread(TraceThreadManager tm, TraceThread eventThread)
    • getTickCount

      long getTickCount()
    • getSkipCount

      long getSkipCount()
    • getPatchCount

      long getPatchCount()
    • isCompatible

      boolean isCompatible(Step step)
      Check if the given step can be combined with this one

      Two steps applied to the same thread can just be summed. If the given step applies to the "last thread" or to the same thread as this step, then it can be combined.

      Parameters:
      step - the second step
      Returns:
      true if combinable, false otherwise.
    • addTo

      void addTo(Step step)
    • subtract

      Step subtract(Step step)
    • clone

      Step clone()
    • rewind

      long rewind(long count)
      Subtract from the count of this step

      If this step has a count exceeding that given, then this method simply subtracts the given number from the tickCount and returns the (negative) difference. If this step has exactly the count given, this method sets the count to 0 and returns 0, indicating this step should be removed from the sequence. If the given count exceeds that of this step, this method sets the count to 0 and returns the (positive) difference, indicating this step should be removed from the sequence, and the remaining steps rewound from the preceding step.

      Parameters:
      count - the count to rewind
      Returns:
      the number of steps remaining
    • compareStep

      CompareResult compareStep(Step that)
      Richly compare this step to another
      Parameters:
      that - the object of comparison (this being the subject)
      Returns:
      a result describing the relationship from subject to object
    • compareStepType

      default CompareResult compareStepType(Step that)
    • compareTo

      default int compareTo(Step that)
      Specified by:
      compareTo in interface Comparable<Step>
    • execute

      default TraceThread execute(TraceThreadManager tm, TraceThread eventThread, PcodeMachine<?> machine, Stepper stepper, TaskMonitor monitor) throws CancelledException
      Throws:
      CancelledException
    • execute

      void execute(PcodeThread<?> emuThread, Stepper stepper, TaskMonitor monitor) throws CancelledException
      Throws:
      CancelledException
    • coalescePatches

      long coalescePatches(Language language, List<Step> steps)