Package ftbsc.lll.utils.debug
Class BytecodePrinter
- java.lang.Object
-
- ftbsc.lll.utils.debug.BytecodePrinter
-
public class BytecodePrinter extends java.lang.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 BytecodePrinter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
insnToString(org.objectweb.asm.tree.AbstractInsnNode insn)
Converts an instruction node to a String.static void
logMethod(org.objectweb.asm.tree.MethodNode main, java.lang.String path)
Logs the bytecode of a method to a file.static void
logMethod(org.objectweb.asm.tree.MethodNode main, org.apache.logging.log4j.Logger logger)
Logs the bytecode of a method using the ASM logger.static void
printMethod(org.objectweb.asm.tree.MethodNode main)
Prints the bytecode of a method using System.out.print().
-
-
-
Method Detail
-
printMethod
public static void printMethod(org.objectweb.asm.tree.MethodNode main)
Prints the bytecode of a method using System.out.print().- Parameters:
main
- the method to print
-
logMethod
public static void logMethod(org.objectweb.asm.tree.MethodNode main, org.apache.logging.log4j.Logger logger)
Logs the bytecode of a method using the ASM logger.- Parameters:
main
- the method to printlogger
- the Log4jLogger
to print it with
-
logMethod
public static void logMethod(org.objectweb.asm.tree.MethodNode main, java.lang.String path)
Logs the bytecode of a method to a file.- Parameters:
main
- the method to printpath
- the file to log it to
-
insnToString
public static java.lang.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
-
-