本文已被:浏览 1987次 下载 4172次
Received:March 10, 2015 Revised:April 26, 2015
Received:March 10, 2015 Revised:April 26, 2015
中文摘要: 函数调用关系能够反映软件系统中函数间的依赖关系,完整的函数调用关系可以更好地辅助程序验证和死锁分析,提升验证和分析的完备性.现有静态分析函数调用关系的方法不能准确分析函数指针和虚函数的调用,影响了其分析结果的准确性.针对这一问题本文提出了一种基于控制流图(Control Flow Graph, CFG)的函数调用关系静态分析方法,该方法首先使用GCC插件静态获取源代码中的类型和函数CFG等信息并构建分析路径,然后采用本文提出的模拟仿真算法分析程序中的语句,并解析函数指针和虚函数的调用,最后基于分析结果生成完整的函数调用关系.实验结果表明,该方法能够很好地支持对函数指针和虚函数的处理,提升了分析结果的准确性.
Abstract:Function call relations can be used to reveal the dependency relations between functions in software systems. An integrated function call relation makes a good contribution to program verification and deadlock analysis, and improves the completeness of verification and analysis. Existing methods of function call relations based on static analysis do not provide integrated support for function pointers or virtual functions, which lowers the accuracy of analysis result. This paper proposes a static analysis method for function call relations generation based on Control Flow Graph(CFG). This method gains source file information by a GCC plugin, and predicts function analysis paths. Then it uses a simulation algorithm proposed by this paper to analyze the statements of those paths, while the call of function pointers and virtual functions are analyzed accurately. It generates full function call relations based on the analysis result. Experimental results show that this method can support the analysis of function pointers and virtual functions, and improves the accuracy of analysis results.
keywords: function call relations static analysis control flow graph function pointer virtual function
文章编号: 中图分类号: 文献标志码:
基金项目:安徽省自然科学基金(1408085MKL06);高等学校学科创新引智计划资助(B07033)
引用文本:
黄双玲,黄章进,顾乃杰.基于CFG的函数调用关系静态分析方法.计算机系统应用,2015,24(11):167-172
HUANG Shuang-Ling,HUANG Zhang-Jin,GU Nai-Jie.Static Analysis Method of Generating Function Call Relations Based on CFG.COMPUTER SYSTEMS APPLICATIONS,2015,24(11):167-172
黄双玲,黄章进,顾乃杰.基于CFG的函数调用关系静态分析方法.计算机系统应用,2015,24(11):167-172
HUANG Shuang-Ling,HUANG Zhang-Jin,GU Nai-Jie.Static Analysis Method of Generating Function Call Relations Based on CFG.COMPUTER SYSTEMS APPLICATIONS,2015,24(11):167-172