Font Size: a A A

Considering The Static Analysis Of Pointer Aliasing

Posted on:2011-05-25Degree:MasterType:Thesis
Country:ChinaCandidate:P F TangFull Text:PDF
GTID:2208360308967407Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Although today's programming languages emerge in endlessly, but the C language as a mainstream language is still widely applied to the development of various systems. Meanwhile, requirements on developers are increasingly high. Because today's high cost of software development, if slightly careless, you may have a serious software failure. Because of this demand, software testing tools come into being. As software testing tools, static code analysis tools can detect software errors or defects without implementing the source code program. In addition, because of its relatively low cost, static code analysis tools are used in more and more companies.Although there are a wide range of current static code analysis tools, the question is that pointer alias analysis is not precise, some tools ignore the alias analysis, or use other forms to replace the pointer alias analysis. As the pointer alias analysis directly affects the accuracy of static analysis tools. In view of those problems in current analysis tools, we design and implement the algorithm of pointer alias, this algorithm applied to the self-developed tools—CChecker.Pointer alias analysis is divided into the pointer alias analysis within the process and the interprocedural pointer alias analysis. we use the method of improved call graph algorithm to realize its alias analysis. Process within the control flow graph uses the method of data flow analysis, by traversing the program control flow graph, records the usage of functions, parameters and variables. Based on the uniqueness of the C language, we design a rule set of alias, a method of pointer alias analysis on the C language within process, and verify the method through examples. Because of the existence of parameters and global variables, the analysis within the process is not perfect, it need to introduce the analysis of the alias between functions. Through expanding the link graph of the call graph generation program to enhance the properties of the link graph, the language-independent algorithm is designed.Based on the CTree, this dissertation designed and implemented the static code analysis tools—CChecker using the approach of object-oriented ,the tool considers the pointer alias. The dissertation designed the system architecture diagram of the static code analysis and function modules. It shows the flow chart diagram of code analysis and describes the main classes and interfaces of the source code static analysis tools. Taking into account the affect of the level of defects or errors, users concerns and file paths, we design commands of static code analysis tools. By comparing the tool we design and CppCheck, CppCheck does not consider the pointer alias analysis, obviously that the code analysis tool has a certain improvement on the accuracy, and practical application prove the utility of the tool.
Keywords/Search Tags:Pointer Alias Analysis, Call Graph, Link Graph, Control Flow Graph, Data Flow Analysis
PDF Full Text Request
Related items