[Soot-list] Hi All,
ASHISH MISHRA
ashish123.mishragkp at gmail.com
Sat Apr 27 13:40:57 EDT 2013
Hi Marc,
Thanks for the response and sorry if I am spamming the list. Following the
other thread and your earlier suggestion , I removed my custom Driver and
started using soot.Main.main(), by creating stub main methods,
Instantiating required Class and Calling the Entry Points explicitly from
there.
Something like this-
*public static void main(String[] args) {*
* *
* ContactManager cm = new ContactManager();*
* Bundle savedins = new Bundle();*
* *
* cm.onCreate(savedins);*
* *
* *
* *
* }// Currently I am modifying the source for test purposes.*
*
*
*
*
Using this I instrument the Body of some of the methods, to get modified
jimple, Which I wish to pass a Call Graph constructor like Paddle or Spark.
For Paddle I do something like this
String[] soot_options= new String[]{
"-w",
//"-full-resolver",
"-p",
"jb",
"use-original-names:true",
"-src-prec",
"jimple",
"-p",
"cg",
"enabled:true",
"-cp",
"./out", //OUT has the instrumented Jimple files from the earlier run of
Soot jtp phase
"-pp",
"-main-class",
args[0],
// "--app",
args[0],
//"-f",
//"jimple"
};
PackManager.v().getPack("wjtp").add(
new Transform("wjtp.myTransform", new SceneTransformer() {
protected void internalTransform(String phase, Map options) {
// CallGraph cg = null;
//set paddle options
HashMap opt = new HashMap();
opt.put("enabled","true");
opt.put("verbose","true");
opt.put("src-prec", "jimple");
opt.put("bdd","true");
opt.put("backend","buddy");
opt.put("context","kcfa");
opt.put("context-heap", "true");
// opt.put("context-counts","true");
opt.put("k","2");
opt.put("propagator","auto");
opt.put("conf","ofcg-aot");
opt.put("order","32");
opt.put("q","auto");
opt.put("set-impl","double");
opt.put("double-set-old","hybrid");
opt.put("double-set-new","hybrid");
opt.put("pre-jimplify","true");
opt.put("whole-program", "true");
PaddleTransformer pt = new PaddleTransformer();
PaddleOptions paddle_opt = new PaddleOptions(opt);
pt.setup(paddle_opt);
pt.solve(paddle_opt);
soot.jimple.paddle.Results.v().makeStandardSootResults();
CallGraph cg=
Scene.v().getCallGraph(); //return paddle call graph
System.out.println("Call Graph" + cg.toString());
}));
soot.Main.main(soot_options);
But still I get the same Exception- as follows
*Exception in thread "main" java.lang.RuntimeException: Exception reference
used other than as the first statement of an exception handler.*
at
soot.jimple.toolkits.typing.fast.AugEvalFunction.eval_(AugEvalFunction.java:162)
at
soot.jimple.toolkits.typing.fast.AugEvalFunction.eval(AugEvalFunction.java:41)
at
soot.jimple.toolkits.typing.fast.TypeResolver.applyAssignmentConstraints(TypeResolver.java:407)
at
soot.jimple.toolkits.typing.fast.TypeResolver.inferTypes(TypeResolver.java:113)
Any Suggestions or help can be a great
Thanks
On Sat, Apr 27, 2013 at 6:38 AM, Marc-André Laverdière-Papineau <
marc-andre.laverdiere-papineau at polymtl.ca> wrote:
> Hi,
>
> I think the other thread on non-static entry points sort of answers that
> question already. But since someone could look at this thread when
> searching the archives, I'm going to just point to Bodden's tutorial :)
>
> Sorry again for getting mixed up on the soot main thing.
> http://www.bodden.de/2012/07/26/soot-custom-entry-points/
>
> Marc-André Laverdière-Papineau
> Doctorant - PhD Candidate
>
> On 04/25/2013 12:04 PM, ASHISH MISHRA wrote:
> >
> > Thanks Marc-Andre for the reply,
> >
> > Sorry for posting the query without any subject.
> > using soot.Main.main(), is it possible to set *entryPoints*. If I set
> > entryPoints and then call soot.Main(options) ,
> > 1)I get a compiler death exception, due to duplicate parsing of the
> > options. do I need to change the main() [make changes to
> > *processCmdLine()*] or Is there some other workaround.
> >
> >
> >
> >
> > On Thu, Apr 25, 2013 at 8:18 PM, Marc-André Laverdière-Papineau
> > <marc-andre.laverdiere-papineau at polymtl.ca
> > <mailto:marc-andre.laverdiere-papineau at polymtl.ca>> wrote:
> >
> > Hello Ashish,
> >
> > My only suggestion would be to try with Soot main :)
> > Anybody got a better idea?
> >
> > Marc-André Laverdière-Papineau
> > Doctorant - PhD Candidate
> >
> > On 04/25/2013 09:46 AM, ASHISH MISHRA wrote:
> > > I am trying to use the Jimple files as input to Paddle Call graph
> > > construction, for this I am setting jimple as the "-src-prec"
> > option and
> > > change the soot-class path appropriately. When I run the soot as
> > > Pack.v().PackMnager(); I get the following exception.
> > >
> > > library
> > >
> >
> path/usr/share/jdk1.7.0_01/jre/lib/i386/server:/usr/share/jdk1.7.0_01/jre/lib/i386:/usr/share/jdk1.7.0_01/jre/../lib/i386:/usr/share/jdk1.6.0_35/jre/lib/i386/client:/usr/share/jdk1.6.0_35/jre/lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib
> > > [Call Graph] For information on where the call graph may be
> > incomplete,
> > > use the verbose option to the cg phase.
> > > */Exception in thread "main" java.lang.RuntimeException: Exception
> > > reference used other than as the first statement of an exception
> > handler./*
> > > */at
> > >
> >
> soot.jimple.toolkits.typing.fast.AugEvalFunction.eval_(AugEvalFunction.java:162)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.typing.fast.AugEvalFunction.eval(AugEvalFunction.java:41)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.typing.fast.TypeResolver.applyAssignmentConstraints(TypeResolver.java:407)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.typing.fast.TypeResolver.inferTypes(TypeResolver.java:113)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.typing.TypeAssigner.internalTransform(TypeAssigner.java:101)/*
> > > */at soot.BodyTransformer.transform(BodyTransformer.java:51)/*
> > > */at soot.Transform.apply(Transform.java:104)/*
> > > */at
> soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:66)/*
> > > */at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:89)/*
> > > */at soot.Pack.apply(Pack.java:124)/*
> > > */at
> > soot.jimple.JimpleMethodSource.getBody(JimpleMethodSource.java:49)/*
> > > */at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:89)/*
> > > */at soot.SootMethod.retrieveActiveBody(SootMethod.java:322)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod(OnFlyCallGraphBuilder.java:531)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables(OnFlyCallGraphBuilder.java:426)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.callgraph.CallGraphBuilder.build(CallGraphBuilder.java:84)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.callgraph.CHATransformer.internalTransform(CHATransformer.java:43)/*
> > > */at soot.SceneTransformer.transform(SceneTransformer.java:39)/*
> > > */at soot.Transform.apply(Transform.java:89)/*
> > > */at soot.RadioScenePack.internalApply(RadioScenePack.java:57)/*
> > > */at
> > >
> >
> soot.jimple.toolkits.callgraph.CallGraphPack.internalApply(CallGraphPack.java:49)/*
> > > */at soot.Pack.apply(Pack.java:114)/*
> > > */at soot.PackManager.runWholeProgramPacks(PackManager.java:417)/*
> > > */at soot.PackManager.runPacks(PackManager.java:336)/*
> > > */at callgraph.PaddleTest.main(PaddleTest.java:290)/*
> > > */
> > > /*
> > > */
> > > /*
> > > After debugging a little further I find out that , No active Body
> is
> > > present for the Entry Method OnCreate(). This looks odd , as I
> > can see
> > > the body present in the JimpleMethodSource's mTree field, I am
> > sure the
> > > problem occurs during Walking this tree to get the Body, but I am
> not
> > > sure Whats the reason.
> > >
> > > NOTE - The problem exists only when I pass the Jimple Body as
> > Input, To
> > > validate the jimple body, I called validate() after any
> > instrumentation
> > > made to the Jimple earlier. and it returns fine.
> > >
> > > Please provide the probable cause of the problem.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Regards,
> > > Ashish Mishra
> > > Graduate Student,
> > > Computer Science and Automation Department,IISc
> > > Cell : +91-9611194714
> > > Mailto : ashishmishra at csa.iisc.ernet.in
> > <mailto:ashishmishra at csa.iisc.ernet.in>
> > > <mailto:ashishmishra at csa.iisc.ernet.in
> > <mailto:ashishmishra at csa.iisc.ernet.in>>
> > >
> > >
> > >
> > > _______________________________________________
> > > Soot-list mailing list
> > > Soot-list at sable.mcgill.ca <mailto:Soot-list at sable.mcgill.ca>
> > > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> > >
> > _______________________________________________
> > Soot-list mailing list
> > Soot-list at sable.mcgill.ca <mailto:Soot-list at sable.mcgill.ca>
> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> >
> >
> >
> >
> > --
> > Regards,
> > Ashish Mishra
> > Graduate Student,
> > Computer Science and Automation Department,IISc
> > Cell : +91-9611194714
> > Mailto : ashishmishra at csa.iisc.ernet.in
> > <mailto:ashishmishra at csa.iisc.ernet.in>
> >
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
--
Regards,
Ashish Mishra
Graduate Student,
Computer Science and Automation Department,IISc
Cell : +91-9611194714
Mailto : ashishmishra at csa.iisc.ernet.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130427/5a33a3fd/attachment-0001.html
More information about the Soot-list
mailing list