Package com.tonic.analysis
Class CodePrinter
- java.lang.Object
-
- com.tonic.analysis.CodePrinter
-
public class CodePrinter extends Object
Bytecode disassembler for converting raw bytecode into human-readable format.
-
-
Constructor Summary
Constructors Constructor Description CodePrinter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringprettyPrintCode(byte[] code, ConstPool constPool)Disassembles raw bytecode into the terse per-instruction listing.static StringprettyPrintCode(CodeAttribute codeAttribute)Disassembles a method'sCodeAttributeusing the terse format that matchesprettyPrintCode(byte[], ConstPool).static StringprettyPrintCode(CodeAttribute codeAttribute, DisassemblyOptions options)Disassembles a method'sCodeAttributewith the enrichments selected byoptions.
-
-
-
Method Detail
-
prettyPrintCode
public static String prettyPrintCode(byte[] code, ConstPool constPool)
Disassembles raw bytecode into the terse per-instruction listing.- Parameters:
code- the method's bytecodeconstPool- the constant pool for resolving references- Returns:
- a string representing the disassembled bytecode
-
prettyPrintCode
public static String prettyPrintCode(CodeAttribute codeAttribute)
Disassembles a method'sCodeAttributeusing the terse format that matchesprettyPrintCode(byte[], ConstPool).- Parameters:
codeAttribute- the method's Code attribute- Returns:
- the disassembled method
-
prettyPrintCode
public static String prettyPrintCode(CodeAttribute codeAttribute, DisassemblyOptions options)
Disassembles a method'sCodeAttributewith the enrichments selected byoptions.- Parameters:
codeAttribute- the method's Code attributeoptions- the enrichments to include- Returns:
- the disassembled method
-
-