Package org.objectweb.asm.util

Examples of org.objectweb.asm.util.TraceCodeVisitor


            a.analyze(ca.classNode, method);
          } catch (Exception ignored) {
          }
          final Frame[] frames = a.getFrames();
         
          TraceCodeVisitor cv = new TraceCodeVisitor(null) {
            public void visitMaxs (int maxStack, int maxLocals) {
              for (int i = 0; i < text.size(); ++i) {
                String s = frames[i] == null ? "null" : frames[i].toString();
                while (s.length() < Math.max(20, maxStack+maxLocals+1)) {
                  s += " ";
                }
                System.err.print(
                  Integer.toString(i + 1000).substring(1) + " " + s + " : "
                  + text.get(i));
              }
              System.err.println();
            }
          };
          for (int j = 0; j < method.instructions.size(); ++j) {
            Object insn = method.instructions.get(j);
            if (insn instanceof AbstractInsnNode) {
              ((AbstractInsnNode)insn).accept(cv);
            } else {
              cv.visitLabel((Label)insn);
            }
          }
          cv.visitMaxs(0, 0);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.util.TraceCodeVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.