Class DebugGenerators

java.lang.Object
com.offbynull.coroutines.instrumenter.generators.DebugGenerators

public final class DebugGenerators extends Object
Utility class to generate bytecode instructions that help debug instrumented code.
  • Constructor Details

    • DebugGenerators

      private DebugGenerators()
  • Method Details

    • debugMarker

      public static org.objectweb.asm.tree.InsnList debugMarker(DebugGenerators.MarkerType markerType, String text)
      Generates instructions for generating marker instructions. These marker instructions are meant to be is useful for debugging instrumented code. For example, you can spot a specific portion of instrumented code by looking for specific markers in the assembly output.
      Parameters:
      markerType - marker type (determines what kind of instructions are generated)
      text - text to print out
      Returns:
      instructions to call System.out.println with a string constant
      Throws:
      NullPointerException - if any argument is null
    • debugPrint

      public static org.objectweb.asm.tree.InsnList debugPrint(org.objectweb.asm.tree.InsnList text)
      Generates instructions for printing out a string using System.out. This is useful for debugging. For example, you can print out lines around your instrumented code to make sure that what you think is being run is actually being run.
      Parameters:
      text - debug text generation instruction list -- must leave a String on the stack
      Returns:
      instructions to call System.out.println with a string constant
      Throws:
      NullPointerException - if any argument is null