Compiler hacking for source code analysis

被引:9
|
作者
Antoniol, G
Di Penta, M
Masone, G
Villano, U
机构
[1] Univ Sannio, Res Ctr Software Technol, Dept Engn, I-82100 Benevento, Italy
[2] Telsey Telecommun SpA, I-82100 Benevento, Italy
关键词
source code analysis tools; gcc; XML; GXL;
D O I
10.1023/B:SQJO.0000039794.29432.7e
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Many activities related to software quality assessment and improvement, such as empirical model construction, data flow analysis, testing or reengineering, rely on static source code analysis as the first and fundamental step for gathering the necessary input information. In the past, two different strategies have been adopted to develop tool suites. There are tools encompassing or implementing the source parse step, where the parser is internal to the toolkit, and is developed and maintained with it. A different approach builds tools on the top of external already-available components such as compilers that output the program abstract syntax tree, or that make it available via an API. This paper discusses techniques, issues and challenges linked to compiler patching or wrapping for analysis purposes. In particular, different approaches for accessing the compiler parsing information are compared, and the techniques used to decouple the parsing front end from the analysis modules are discussed. Moreover, the paper presents an approach and a tool, XOgastan, developed exploiting the gcc/g++ ability to save a representation of the intermediate abstract syntax tree. XOgastan translates the gcc/g++ dumped abstract syntax tree format into a Graph eXchange Language representation, which makes it possible to take advantage of currently available XML tools for any subsequent analysis step. The tool is illustrated and its design discussed, showing its architecture and the main implementation choices made.
引用
收藏
页码:383 / 406
页数:24
相关论文
共 50 条
  • [1] Compiler Hacking for Source Code Analysis
    G. Antoniol
    M. Di Penta
    G. Masone
    U. Villano
    Software Quality Journal, 2004, 12 : 383 - 406
  • [2] Hacking Adaptation: Updating, Porting, and Forking the Shakespearean Source Code
    Winckler, Reto
    ADAPTATION-THE JOURNAL OF LITERATURE ON SCREEN STUDIES, 2021, 14 (01): : 1 - 22
  • [3] Flow Analysis on Intermediate Source Code for WCET Estimation of Compiler-Optimized Programs
    Wang, Zhonglei
    Herkersdorf, Andreas
    2009 15TH IEEE INTERNATIONAL CONFERENCE ON EMBEDDED AND REAL-TIME COMPUTING SYSTEMS AND APPLICATIONS, PROCEEDINGS, 2009, : 22 - 27
  • [4] Source-Code-to-Object-Code Traceability Analysis for Avionics Software: Don't Trust Your Compiler
    Brauer, Joerg
    Dahlweid, Markus
    Pankrath, Tobias
    Peleska, Jan
    COMPUTER SAFETY, RELIABILITY, AND SECURITY, SAFECOMP 2015, 2015, 9337 : 427 - 440
  • [5] C-COMPILER IN ONE PASS OPTIMIZES SOURCE CODE
    WALLER, L
    ELECTRONICS-US, 1983, 56 (21): : 48 - 49
  • [6] _toFlowchart: A Prototype Compiler to Convert Source-Code to Flowchart
    Shafeek, Nasik
    Karunarathne, Damitha D.
    2018 18TH INTERNATIONAL CONFERENCE ON ADVANCES IN ICT FOR EMERGING REGIONS (ICTER) CONFERENCE PROCEEDINGS, 2018, : 157 - 167
  • [7] Hacking the Tax Code
    Schneier, Bruce
    IEEE SECURITY & PRIVACY, 2020, 18 (05) : 79 - 80
  • [8] Comparing Mutation Testing at the Levels of Source Code and Compiler Intermediate Representation
    Hariri, Farah
    Shi, August
    Fernando, Vimuth
    Mahmood, Suleman
    Marinov, Darko
    2019 IEEE 12TH CONFERENCE ON SOFTWARE TESTING, VALIDATION AND VERIFICATION (ICST 2019), 2019, : 114 - 124
  • [10] TO-BE-RECORDED ANALYSIS INSIDE DERIVATIVE CODE COMPILER
    Shodiq, Muhsin
    Gendler, Boris
    Naumann, Uwe
    PROCEEDINGS OF THE 2011 3RD INTERNATIONAL CONFERENCE ON SOFTWARE TECHNOLOGY AND ENGINEERING (ICSTE 2011), 2011, : 7 - 12