Class BytecodePrinter

java.lang.Object
ftbsc.lll.utils.debug.BytecodePrinter

public class BytecodePrinter extends Object
A collection of static methods for debugging by printing the ASM bytecode. These methods are only for debug, so most of the time they should stay unused.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    insnToString(org.objectweb.asm.tree.AbstractInsnNode insn)
    Converts an instruction node to a String.
    static void
    logMethod(org.objectweb.asm.tree.MethodNode main)
    Logs the bytecode of a method on System.out.
    static void
    logMethod(org.objectweb.asm.tree.MethodNode main, String path)
    Logs the bytecode of a method to a file.
    static void
    logMethod(org.objectweb.asm.tree.MethodNode main, Consumer<String> logFn)
    Logs the bytecode of a method into a given sink.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BytecodePrinter

      public BytecodePrinter()
  • Method Details

    • logMethod

      public static void logMethod(org.objectweb.asm.tree.MethodNode main)
      Logs the bytecode of a method on System.out.
      Parameters:
      main - the method to print
    • logMethod

      public static void logMethod(org.objectweb.asm.tree.MethodNode main, Consumer<String> logFn)
      Logs the bytecode of a method into a given sink.
      Parameters:
      main - the method to print
      logFn - a consumer for the string, typically a logging function
      Since:
      0.6.0
    • logMethod

      public static void logMethod(org.objectweb.asm.tree.MethodNode main, String path)
      Logs the bytecode of a method to a file.
      Parameters:
      main - the method to print
      path - the file to log it to
    • insnToString

      public static String insnToString(org.objectweb.asm.tree.AbstractInsnNode insn)
      Converts an instruction node to a String.
      Parameters:
      insn - the node to convert
      Returns:
      the converted string