[Soot-list] questions about using soot to generate dot documents

张晓箐 ddhk1991 at gmail.com
Sat Oct 11 10:52:43 EDT 2014


  I have some questions about using soot to generate the dot documents.
  I can use the command line to generate the dot documents for each method
of a class, but the graph is BriefUnitGraph  not   ExceptionalUnitGraph,
 for example:

  public class Foo {
 int bar(int n) {
 f();
try {
Socket socket = new Socket("127.0.0.1",10000);
}catch(Exception e) {
e.printStackTrace();
}
return n + 20;
}
  void f() {
 int x = 10;
 boolean b = false;
 if(b) {
 System.out.println(x);
 }
 else {
 System.out.println("x is not zero");
 }
 System.out.println("call g()");
 }
 public static void main(String[] args) {
Foo f = new Foo();
int a = 7;
int b = 14;
}
}
 then I use the "java soot.tools.CFGVIewer -f  J Foo" command line , it can
genarate the dot documents for each method of the class.

( capture1.JPG in the accessories is using the command  line to generate
the dot documents , capture2.JPG is the results of using the command line.)

but the graph is not ExceptionalUnitGraph, then the graph of the bar method
in the Foo class is not correct,there is no edge from try to catch.  so
here are my questions:
First ,  what  command line can I use  to  generate a ExceptionalUnitGraph
type of control flow graph file(dot documents) for each method of the class?
Second , can I use the soot API to  generate the dot documents with the
ExceptionalUnitGraph type for each  method of the class?If the soot API is
feasible, then could you give me an example?

Thanks very much.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141011/d33008eb/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: capture1.JPG
Type: image/jpeg
Size: 71963 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141011/d33008eb/attachment-0002.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: capture2.JPG
Type: image/jpeg
Size: 32597 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141011/d33008eb/attachment-0003.jpe 


More information about the Soot-list mailing list