public class BytecodePrinter
extends java.lang.Object
Constructor and Description |
---|
BytecodePrinter() |
Modifier and Type | Method and 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)
Logs the bytecode of a method on System.out.
|
static void |
logMethod(org.objectweb.asm.tree.MethodNode main,
java.util.function.Consumer<java.lang.String> logFn)
Logs the bytecode of a method into a given sink.
|
static void |
logMethod(org.objectweb.asm.tree.MethodNode main,
java.lang.String path)
Logs the bytecode of a method to a file.
|
public static void logMethod(org.objectweb.asm.tree.MethodNode main)
main
- the method to printpublic static void logMethod(org.objectweb.asm.tree.MethodNode main, java.util.function.Consumer<java.lang.String> logFn)
main
- the method to printlogFn
- a consumer for the string, typically a logging functionpublic static void logMethod(org.objectweb.asm.tree.MethodNode main, java.lang.String path)
main
- the method to printpath
- the file to log it topublic static java.lang.String insnToString(org.objectweb.asm.tree.AbstractInsnNode insn)
insn
- the node to convert