org.objectweb.asm.util
public class TraceClassVisitor extends PrintClassVisitor
The trace printed when visiting the Hello class is the following:
where Hello is defined by:// compiled from Hello.java public class Hello { public static main ([Ljava/lang/String;)V GETSTATIC java/lang/System out Ljava/io/PrintStream; LDC "hello" INVOKEVIRTUAL java/io/PrintStream println (Ljava/lang/String;)V RETURN MAXSTACK = 2 MAXLOCALS = 1 public <init> ()V ALOAD 0 INVOKESPECIAL java/lang/Object <init> ()V RETURN MAXSTACK = 1 MAXLOCALS = 1 }
public class Hello { public static void main (String[] args) { System.out.println("hello"); } }
Field Summary | |
---|---|
protected ClassVisitor | cv
The {@link ClassVisitor ClassVisitor} to which this visitor delegates
calls. |
Constructor Summary | |
---|---|
TraceClassVisitor(ClassVisitor cv, PrintWriter pw)
Constructs a new {@link TraceClassVisitor TraceClassVisitor} object.
|
Method Summary | |
---|---|
static void | main(String[] args)
Prints a disassembled view of the given class to the standard output.
|
void | visit(int version, int access, String name, String superName, String[] interfaces, String sourceFile) |
void | visitAttribute(Attribute attr) |
void | visitEnd() |
void | visitField(int access, String name, String desc, Object value, Attribute attrs) |
void | visitInnerClass(String name, String outerName, String innerName, int access) |
CodeVisitor | visitMethod(int access, String name, String desc, String[] exceptions, Attribute attrs) |
Parameters: cv the class visitor to which this adapter must delegate calls. May be null. pw the print writer to be used to print the class.
Usage: TraceClassVisitor [-debug] <fully qualified class name or class file name >
Parameters: args the command line arguments.
Throws: Exception if the class cannot be found, or if an IO exception occurs.