摘要: 提出一种带有控制流的静态函数调用分析的方法,通过建立模型,对源程序进行静态分析,得到程序中的控制流信息和函数调用信息。和已有的静态函数调用关系图分析工具calltree和Source Insight相比,该方法生成的函数调用流图不仅能展现函数间的调用次序,还可以了解程序设计的逻辑复杂度,有助于代码阅读和分析人员更快更好地理解程序结构以及设计流程,并为分析程序控制条件、设计路径覆盖测试用例和进行程序优化奠定基础。
关键词:
静态分析,
控制流,
函数调用,
程序优化
Abstract: This paper puts forward a new method for the static function call analysis with control flow, by which can get the information of control flow and function call through creating a model to carry out static analysis of the source code. Comparing with existing tools like calltree and Source Insight, the function call flow graph generated by using the new method can not only reveal the call order of the functions, but also help to understand the complexity of the logic of the program. With the help of the new function call flow graph, the code reader has a better mastery of control flow of the program and a better understanding of the structure and design of the program. It also provides the basis of convenience to analyse control conditions of the program, design path coverage test cases and optimization for the program.
Key words:
static analysis,
control flow,
function call,
program optimization
中图分类号:
陈忠湘, 詹瑾瑜, 郝宗波. 带控制流的静态函数调用分析方法[J]. 计算机工程, 2011, 37(9): 47-50.
CHEN Zhong-Xiang, DAN Jin-Yu, HAO Zong-Bei. Method for Static Function Call Analysis with Control Flow[J]. Computer Engineering, 2011, 37(9): 47-50.