[Soot-list] Exception in JasminClass after adding static method invocation

Jae-Woo Lee lee575 at purdue.edu
Mon Apr 6 21:48:41 EDT 2009


Okay. It works well now.
Thank you so much.

Sincerely,
Jaewoo

Quoting Patrick Lam <plam at cs.mcgill.ca>:

> Jae-Woo Lee wrote:
> > Hi.
> > 
> > I am working on adding a profiling code after analysis.
> > When I add a static method invocation and when it is written with
> JasminClass,
> > it generates ClassCastException.
> > I just added a static method invocation in the source code of "Creating a
> Class
> > File from Scratch" document.
> > 
> > Do you have any idea what is wrong in my code ?
> > 
> > ========= code snippet for adding static method invocation ==========
> > 
> > // insert DynamicRefCounter.incrementEscapingObjectCnt()
> > {
> >     Scene.v().loadClassAndSupport("myanalysis.DynamicRefCounter");
> >     SootMethod myCall = Scene.v().getMethod("<myanalysis.DynamicRefCounter:
> void
> > incrementEscapingObjectCnt()>");
> >    
> System.out.println(Jimple.v().newStaticInvokeExpr(myCall.makeRef()).toString());
> >                
> units.add(Jimple.v().newStaticInvokeExpr(myCall.makeRef()));
> 
> Hi Jae-Woo,
> 
> You need to create an InvokeStmt and put the StaticInvokeExpr inside the
> InvokeStmt. An Expr is not a Stmt or a Unit, and the units list should
> only contain Units.
> 
> pat
> 
> 




More information about the Soot-list mailing list