X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fcom%2Fbrian_web%2Fgcclass%2FDumpCP.java;fp=src%2Fcom%2Fbrian_web%2Fgcclass%2FDumpCP.java;h=fb6cfb2efbf7337c06d37df047242d4db3ab876f;hb=f613046d131a288e4dccfb6454eba64d5187d4de;hp=0000000000000000000000000000000000000000;hpb=70d691dafdf46d2b8dc43f61af57fec573694166;p=org.ibex.gcclass.git diff --git a/src/com/brian_web/gcclass/DumpCP.java b/src/com/brian_web/gcclass/DumpCP.java new file mode 100644 index 0000000..fb6cfb2 --- /dev/null +++ b/src/com/brian_web/gcclass/DumpCP.java @@ -0,0 +1,23 @@ +// Copyright (C) 2004 Brian Alliet + +package com.brian_web.gcclass; + +import java.util.*; +import java.io.*; +import org.apache.bcel.util.*; +import org.apache.bcel.classfile.*; + +public class DumpCP { + public static void main(String[] args) throws Exception { + if(args.length < 2) { + System.err.println("Usage DumpCP classpath class"); + System.exit(1); + } + String classpath = ClassPath.SYSTEM_CLASS_PATH + File.pathSeparator + args[0]; + Repository repo = SyntheticRepository.getInstance(new ClassPath(classpath)); + + JavaClass c = repo.loadClass(args[1]); + ConstantPool cp = c.getConstantPool(); + System.out.println(cp); + } +}