简体   繁体   English

如何使用Soot创建控制流图?

[英]How to create a control-flow graph with Soot?

For a while I have been struggling with creating a control-flow graph with Soot and I kinda got lost in its tutorials . 一段时间以来,我一直在努力使用Soot创建控制流图,而我却迷失在其教程中 Rather than using Soot as an Eclipse plugin, I have been trying to use Soot as a library or API. 我一直在尝试将Soot用作库或API,而不是将Soot用作Eclipse插件。

What I want to do is, I have a bunch of Java projects and I want to create/generate a control-flow graph of these projects. 我想做的是,我有很多Java项目,我想创建/生成这些项目的控制流图。 I also saw that there is a feature in Soot that I can generate control-flow graphs in "DOT" format, which is quite acceptable for me as well. 我还看到Soot中有一个功能,可以生成“ DOT”格式的控制流图,这对我来说也是可以接受的。

Any guide or sample of code that shows how to create/generate a control-flow graph with Soot would be great! 任何显示如何使用Soot创建/生成控制流图的指南或代码示例都将很棒!

You can create a method-local CFG by just creating a new ExceptionalUnitGraph, passing it the method's SootBody. 您可以通过仅创建一个新的ExceptionalUnitGraph并将方法的SootBody传递给它来创建方法本地的CFG。 The Soot Tutorial in the wiki shows you how to do that. Wiki中的Soot教程向您展示了如何做到这一点。

To get an inter-procedural CFG, ie, an ICFG, you can use the Soot extension Heros: https://github.com/Sable/heros/blob/develop/src/heros/InterproceduralCFG.java 要获得过程间CFG,即ICFG,可以使用Soot扩展英雄: https : //github.com/Sable/heros/blob/develop/src/heros/InterproceduralCFG.java

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM