[Soot-list] Question about CallGraph
Thanh Son IT
thanhson at saigonpostel.com.vn
Mon Jan 22 20:42:15 EST 2007
Thanks,
I solved this problem. Yesterday, I used JDK 1.5.
Today, I return JDK 1.4 and don't see this error.
Would you like to explain this error for me?
BRs,
----- Original Message -----
From: "Eric Bodden" <eric.bodden at mail.mcgill.ca>
To: "Thanh Son IT" <thanhson at saigonpostel.com.vn>
Cc: <soot-list at sable.mcgill.ca>
Sent: Tuesday, January 23, 2007 1:02 AM
Subject: RE: [Soot-list] Question about CallGraph
Hmm, this definitely does not seem to be related to your transformation.
I assume that rather something is wrong (or at least unexpected) with
the bytecode that you feed in. How did you compile the class file for
"aaa" ?
Are you sure, you only have a single soot jar file on your classpath and
not accidentally any other version of coffi or so?
Eric
> -----Original Message-----
> From: soot-list-bounces at sable.mcgill.ca [mailto:soot-list-
> bounces at sable.mcgill.ca] On Behalf Of Thanh Son IT
> Sent: Sunday, January 21, 2007 9:16 PM
> To: soot-list at sable.mcgill.ca
> Subject: [Soot-list] Question about CallGraph
>
> Hi,
>
> I'm using Soot verison 2.2.3.
> I want add a Transformer into user-define Pack "wjtp".
>
> --------------------------------------------
> /* Usage: java Main [soot-options] appClass */
> /* import necessary soot packages */
> import soot.*;
> import java.io.*;
>
> public class Main {
> public static void main(String[] args) {
>
> /* check the arguments */
> if (args.length == 0) {
> System.err.println("Usage: java Main [options] classname");
> System.exit(0); }
>
> /* add a phase to transformer pack by call Pack.add */
>
> PackManager.v().getPack("wjtp").add(new
> Transform("wjtp.name",stm123.v()));
>
> /* Give control to Soot to process all options,
> * InvokeStaticInstrumenter.internalTransform will get called.
> */
> soot.Main.main(args);
> }
> }
> --------------------------------------------------------------
>
> import soot.*;
> import soot.jimple.*;
> import soot.util.*;
> import java.util.*;
> import java.io.*;
>
> class stm123 extends SceneTransformer{
> private static stm123 instance = new stm123(); private stm123() {}
> public static stm123 v() { return instance; }
>
> protected void internalTransform(String phaseName, Map options) {
> //options.v().set_whole_program(true);
> //CHATransformer.v().transform();
> //CallGraph cg = Scene.v().getCallGraph();
> //System.out.println(cg.size());
>
> System.out.println("test");
> }
> }
>
>
-----------------------------------------------------------------------
>
> import java.io.*;
>
> class aaa {
> public static void main(String[] arg) {
> UI ui = new TextUI();
> ui.display("Hello World");
> }
> }
>
>
-----------------------------------------------------------------------
> ------
>
> When I use command:
> > java Main -w aaa
>
> the following error occured:
>
> Soot started on Mon Jan 22 08:58:59 ICT 2007 Exception in thread
"main"
> java.lang.ClassCastException: soot.coffi.CONSTANT_Class_info
> at soot.coffi.Util.addAnnotations(Util.java:980)
> at
> soot.coffi.Util.addAnnotationVisibilityAttribute(Util.java:942)
> at soot.coffi.Util.resolveFromClassFile(Util.java:409)
> at soot.CoffiClassSource.resolve(CoffiClassSource.java:37)
> at soot.SootResolver.bringToHierarchy(SootResolver.java:148)
> at soot.SootResolver.bringToSignatures(SootResolver.java:172)
> at soot.SootResolver.bringToBodies(SootResolver.java:214)
> at
> soot.SootResolver.processResolveWorklist(SootResolver.java:100)
> at soot.SootResolver.resolveClass(SootResolver.java:89)
> at soot.Scene.tryLoadClass(Scene.java:298)
> at soot.Scene.loadBasicClasses(Scene.java:848)
> at soot.Scene.loadNecessaryClasses(Scene.java:874)
> at soot.Main.run(Main.java:170)
> at soot.Main.main(Main.java:146)
> at Main.main(Main.java:40)
>
>
>
>
More information about the Soot-list
mailing list