[Soot-list] Get Caller Stmt and SootMethod in Callgraph

R.F. rayfang1991 at hotmail.com
Thu Jul 16 09:52:15 EDT 2015


Hi,

I want to find the caller Stmt and the SootMethod which the Stmt belongs to
in the callgraph (for example, given that SootMethod m1 is invoked by
SootMethod m2 with m2's statement s1, now I have m1, and I want to find
both m2 and s1).

I have tried two approaches:

   1. JimpleBasedInterproceduralCFG.getCallersOf(SootMethod m), this method
   returns a collection of Unit, but from the returned collection of Unit, I
   cannot get the SootMethod which each Unit belongs to.
   2. Scene.v().getCallGraph().edgesInto(SootMethod m), this method returns
   an iterator of SootMethod. To get the Stmt, I need to iterate through all
   the Stmt of each SootMethod and find the one by matching
   stmt.getInvokeExpr().getMethod() with the given SootMethod by signature.
   However, I think simply matching by SootMethod's signature may fail to find
   the Stmt because the given method can be an override method, so their
   signatures will not match.

So, is there a method to find the caller Stmt and SootMethod in callgraph
accurately even with override and overload?

Moreover, Marc-André Laverdière mentioned
the JimpleBasedInterproceduralCFG-based method in
https://mailman.cs.mcgill.ca/pipermail/soot-list/2014-July/007043.html with
the notion that "as long as you don't mind context-insensitive results".
Can someone tell me what are "context-insensitive results"?

Thank you in advance.


Best Regards,
R.F.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150716/ea2e11cc/attachment.html 


More information about the Soot-list mailing list