use of org.objectweb.asm.util.TraceClassVisitor in project CodeChickenLib by Chicken-Bones.
the class ASMHelper method dump.
public static void dump(Acceptor acceptor, File file, boolean filterImportant, boolean sortLocals, boolean textify) {
try {
if (!file.getParentFile().exists())
file.getParentFile().mkdirs();
if (!file.exists())
file.createNewFile();
PrintWriter pout = new PrintWriter(file);
ClassVisitor cv = new TraceClassVisitor(null, textify ? new Textifier() : new ASMifier(), pout);
if (filterImportant)
cv = new ImportantInsnVisitor(cv);
if (sortLocals)
cv = new LocalVariablesSorterVisitor(cv);
acceptor.accept(cv);
pout.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of org.objectweb.asm.util.TraceClassVisitor in project pinpoint by naver.
the class ASMClassWriterTest method accept.
@Test
public void accept() throws Exception {
final String className = "com.navercorp.pinpoint.profiler.instrument.mock.SampleClass";
ClassNode classNode = ASMClassNodeLoader.get(JavaAssistUtils.javaNameToJvmName(className));
ASMClassWriter cw = new ASMClassWriter(pluginContext, 0, null);
TraceClassVisitor tcv = new TraceClassVisitor(cw, null);
classNode.accept(tcv);
}
use of org.objectweb.asm.util.TraceClassVisitor in project bytecode-viewer by Konloch.
the class ASMTextifierDisassembler method decompileClassNode.
@Override
public String decompileClassNode(ClassNode cn, byte[] b) {
StringWriter writer = new StringWriter();
cn.accept(new TraceClassVisitor(null, new Textifier(), new PrintWriter(writer)));
return writer.toString();
}
use of org.objectweb.asm.util.TraceClassVisitor in project lwjgl by LWJGL.
the class MappedObjectTransformer method printBytecode.
private static void printBytecode(byte[] bytecode) {
StringWriter sw = new StringWriter();
ClassVisitor tracer = new TraceClassVisitor(new ClassWriter(0), new PrintWriter(sw));
new ClassReader(bytecode).accept(tracer, 0);
String dump = sw.toString();
LWJGLUtil.log(dump);
}
use of org.objectweb.asm.util.TraceClassVisitor in project tomee by apache.
the class Asmifier method write.
public static void write(final ClassReader reader, final OutputStream write) throws IOException {
final TraceClassVisitor visitor = new TraceClassVisitor(null, new ASMifier(), new PrintWriter(write));
reader.accept(visitor, ClassReader.SKIP_DEBUG);
write.close();
}
Aggregations