Interface Stepper

All Known Implementing Classes:
DebugStepper, NullStepper

public interface Stepper
Stepper is used to push snapshots of the decompiler state into the Debugger/Viewer. Push/Pop calls should be wound around any serious transformation performed during the decompiler's operation.

You can obtain an instance via stepper(), it is recommended to store it in a private static final field, as you would a logger.

Created by covers1624 on 12/5/21.

  • Method Details

    • stepper

      static Stepper stepper()
      Retrieve an instance of the stepper.

      The value returned by this is valid for the entire application lifetime, and should usually be stored in a static final field.

      Think of this like a Logger.getLogger() call.

      Returns:
      The stepper.
    • isEnabled

      boolean isEnabled()
      Returns:
      If step capture is enabled.
    • getOpts

      Get the DebugPrintOptions for this stepper.
      Returns:
      The DebugPrintOptions.
    • pushStep

      void pushStep(String name)
      Starts a step in the current context.
      Parameters:
      name - A descriptive name for the step.
    • pushStep

      void pushStep(String name, StepContextType contextType)
      Starts a step in the current context.
      Parameters:
      name - A descriptive name for the step.
    • pushStep

      void pushStep(String name, StepContextType contextType, Stepper.CodeContext context)
      Starts a step in the current context.
      Parameters:
      name - A descriptive name for the step.
    • popStep

      void popStep()
      Stops a transformation step.
    • topLevelStep

      void topLevelStep(String name, StepContextType contextType, Stepper.CodeContext context, Runnable r)
      Starts a top-level step.

      If the given runnable throws an exception, will correctly unwind the stepper tree state and attribute the error to the currently executing step.

      Parameters:
      name - A descriptive name for the step.
      r - Runnable wrapper for exception tracking.
    • pushTiming

      void pushTiming(String name)
      Starts a non-content step.
      Parameters:
      name - The name.
    • popTiming

      void popTiming()
      Stops a non-content step.
    • addInfo

      void addInfo(String name, Supplier<String> info)
      Add a step with a text info blob.
      Parameters:
      name - The name.
      info - The info blob.
    • addInfo

      void addInfo(String name, Supplier<String> left, Supplier<String> right)
      Add a step with a 2 part info blob, rendered as a diff.
      Parameters:
      name - The name.
      left - The left info blob.
      right - The right info blob.
    • addInfoDiff

      void addInfoDiff(String name, Supplier<String> left, Supplier<String> right)
      Add a step wth a 2 part info blob.
      Parameters:
      name - The name.
      left - The left info blob.
      right - The right info blob.
    • addVariableLivenessGraph

      void addVariableLivenessGraph(String name, VariableLivenessGraph graph)
    • addControlFlowGraph

      void addControlFlowGraph(String name, ControlFlowNode cfNode)