[Soot-list] How to redirect Soot output to Eclipse console?

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Thu Jun 9 12:20:50 EDT 2011


Hi.

I suspect that the CGDumper is never actually called. Did you supply
the -w option to enable the whole-program packs?

The println statement should not be the problem.

Eric

On 9 June 2011 07:26, Yepang Liu <yepangliu at gmail.com> wrote:
> Hi all,
> I am a Soot beginner. I tried the following example in Eclipse to print out
> the call graph in textual format.
> public class CGDumper extends SceneTransformer {
> protected void internalTransform(String phaseName,Map options){
> CallGraph cg=Scene.v().getCallGraph();
> Iterator<Edge> it=cg.listener();
> while(it.hasNext()){
> Edge e=(Edge) it.next();
> G.v().out.println(e.src().toString()+e.srcStmt().toString()+"
> ="+e.kind().toString()+" =>"+e.tgt().toString());
> }
> }
> public static void main(String[] args) {
> PackManager.v().getPack("wjtp").add(new Transform("wjtp.cgdumper",new
> CGDumper()));
> soot.Main.main(args);
> }
> }
> And my test class is as follows.
> public class Test {
> public static void foo(){
> bar();
> }
> public static void bar(){
> }
> public static void func(){
> }
> public static void main(String[] args) {
> foo();
> func();
> }
> }
> Using G.v().out.println() method, I expect the output from Soot will be
> redirected to the Eclipse console. But in fact, I see nothing except the
> following information.
> Starting from project BodyTransformer:
> CGDumper --d /Users/andrew/java_workspace/BodyTransformer/sootOutput --cp
> /Library/Java/JavaVirtualMachines/1.6.0_24-b07......
> Soot started on Thu Jun 09 13:13:56 HKT 2011
> Transforming Test...
> Writing to
> /Users/andrew/java_workspace/BodyTransformer/sootOutput/Test.class
> Soot finished on Thu Jun 09 13:13:57 HKT 2011
> Soot has run for 0 min. 1 sec.
> Can anyone help me? Thank you very much!
> Best Regards,
> Yepang
>
>
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Dr. Eric Bodden, http://bodden.de/
Principal Investigator in Secure Services at CASED
Coordinator of the CASED Advisory Board of Study Affairs
PostDoc at Software Technology Group, Technische Universität Darmstadt
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list