C++ Static Analyzer’s Development Based on GCC

Author
DanShiHua
Advisor
WangAnSheng
School
Beijing University of Posts and Telecommunications
Major
Software Engineering
Classification
TP311.52 Software Development
Degree
Master's thesis
Year
2009
Downloads
159
Citations
1

Request the full text

Abstract

C has become one of the most mainstream of the development of language, more and more use of C language development tools, especially in some important areas, such as: vehicle control, aerospace fields. With the development of computer technology, the C language development tools in the field of aerospace has been widely used, not just ground, radar systems, such as aerospace, missile systems become more and more important. Since the efficiency and other characteristics of the C C must be more widely and more important applications. However, due to the complexity of the C language system, a software program developed using the C language, the inevitable with defects. So we need self-developed set of test tools to ensure that the software program safe and reliable operation. C static analyzer is part of the project, the development of C static analyzer, testers, developers can examine the code and found flaws in the code, to ensure the safety and reliability of the code. First of all, according to the \To the MISRA C: 2008, focus on describing the common C errors, according to an important extent, is divided into rules and recommendations. When authoring tool error to be distinguished. The C static checking rule 1.0 is a manual prepared by our own, as technology evolves, you can update the manual at any time, C static analyzer developed more in line with the field of aerospace. Secondly, C static analyzer as the basis for the development of open source compiler GCC. GCC is one of the most successful open source tools, Codes, strict. Use the GCC to ensure that the tools have a good cross-platform, and can be a large degree of assurance of the quality of software development. According to Rule 1.0 of the C static checking process, check the rules for classification, mainly divided into lexical analysis, syntax analysis, and semantic analysis process. This paper focuses on the the GCC C compiler process, the process of program logic and GCC symbol table. GCC proper use of the symbol table is the basis of the rule checking, symbol table lookup, the analysis is also key and difficult. Finally, the article focuses on the application of the rule checking GCC steps, methods, and specific implementation process as well as a simple test case. Test cases run, C static analyzer is correct and feasible, the application of this tool can detect defects in the source code.

Table of contents

Abstract 4-5 ABSTRACT 5-9 Chapter 1 Introduction 9-15 1.1 topics background 9-10 < br /> 1.2 I work 10 1.3 paper structure 10-11 1.4 development environment requirements 11 1.5 GCC compiler Profile 11-15 checking rules discussed in Chapter C 15-34 2.1 C language latent defects 15-16 2.2 C inspection rules 16-33 2.3 Summary 33-34 Chapter compiler structure and processes 34-44 3.1 compiler basic principle 34 3.2 lexical analysis 34-37 3.2.1 grammar 34-35 3.2.2 lexical analysis 35-36 < br /> 3.2.3 word description tool 36-37 3.2.4 DFA 37 3.3 syntax analysis 37-39 <br / > 3.3.1 LR analysis 37 3.3.2 LR analysis Overview 37-39 3.4 syntax-directed translation and intermediate code generation 39-43 <br / > 3.4.1 attribute grammar 39 3.4.2 simple assignment statements translation 39-40 3.4.3 Boolean expressions translation 40-41 < br /> 3.4.4 control Structures translation 41-42 3.4.5 arrays and structures translation 42 3.4.6 structure ( record ) the translation of descriptions and references 42-43 3.5 Summary 43-44 fourth chapter analyzes and symbol table lookup 44-63 4.1 the role and symbol table status 44 4.2 symbol Table organization 44-46 4.3 GCC in the TREE structure 46-59 4.4 symbol table lookup 59-62 4.5 Summary 62-63 Chapter rule implementation methods and engineering process 63-73 5.1 rules implemented method 63-71 5.2 works to achieve the inspection rules 71-73 Chapter Summary and Outlook 73-74 References 74 -76 Thanks 76

Related dissertations

  1. Research and Implementation of the Autovectorization for YHFT-Matrix Complier
  2. The Gulf Regional Cooperation after the Cold War: a Regionalism Perspective
    YuZhen ·Shanghai International Studies University ·2014 ·Doctoral dissertation
  3. A New Algorithm of Sound Source Localization Based on Special Acoustic Detection
  4. Technical Structure Analysis for Chinese Manufactured Goods Export to GCC
    RenMin ·Ningxia University ·2013 ·Master's thesis
  5. Algorithm Research and Localization System Design of In-Tank Robot Based on Microphone Array
    ZuoSongHua ·Shanghai Jiaotong University ·2012 ·Master's thesis
  6. Analyze and Transplant of GCC Compiler Based on the Platform of SPARC
  7. The Design and Implementation of Testing Service System Based on Software Behavior Analysis
    ShenYi ·Nanjing University ·2013 ·Master's thesis
  8. Study on sound source localization algorithm based on time delay estimation
    ZhangQing ·North China University of Technology ·2012 ·Master's thesis
  9. Study on the construction of the six Gulf countries security from the perspective of Communitarianism
    LiuBin ·Shanghai International Studies University ·2013 ·Doctoral dissertation
  10. Research status of civilian nuclear energy policy and the development of the GCC countries
  11. To Study the Influence of Laparoscopic and Open Radical Operation of Colorectal Carcinoma on Hematogenous Micrometastasis by the Combinative Detection of GCC MRNA and HTERT MRNA
    JiangShaoFeng ·Central South University ·2012 ·Master's thesis
  12. Pituitary tumor of optic nerve pathway anatomical, electrophysiological characteristics and functional imaging based on transsphenoidal recovery related factors of vision after operation
    QiaoNiDan ·Fudan University ·2012 ·Doctoral dissertation
  13. Research on the Core Mechanism of ITU-T T.120-Based Multimedia Data Conference System & Its Implementation Techniques over Internet
    ChenHaiYan ·East China Normal University ·2004 ·Master's thesis
  14. Research and Development of the Cross Compiler Based on GCC for Embedded System
    FengGang ·Zhejiang University ·2004 ·Master's thesis
  15. GCC compiler system architecture analysis and back-end transplant practice
    CaiJie ·Zhejiang University ·2004 ·Master's thesis
  16. Research on Compiler Optimization Technologies for THUMP
    CuiHuiMin ·Tsinghua University ·2003 ·Master's thesis
  17. Research and Implementation of Cross-compiler System
    SuZuoZuo ·Zhejiang University ·2003 ·Master's thesis
  18. Design and Implementation of a Porting Assistant System for Retargetable Compiler
    ZengZuo ·Xiamen University ·2006 ·Master's thesis
  19. The Primary Assembler Optimizing of DSP C Compiler Based on GCC
    ZuoFeng ·Suzhou University ·2005 ·Master's thesis
  20. Research on Static Single Assignment Optimization Technique Based on GCC
    WuJing ·Harbin Engineering University ·2006 ·Master's thesis