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 条
  • [41] OPTIMIZATION OF ASSEMBLY CODE GENERATION IN A COMPILER
    HURA, GS
    MICROELECTRONICS AND RELIABILITY, 1982, 22 (05): : 1035 - 1036
  • [42] A COMPARISON OF COMPILER-GENERATED CODE
    TOMMELEIN, A
    TIBERGHIEN, J
    MICROPROCESSING AND MICROPROGRAMMING, 1985, 15 (02): : 47 - 56
  • [43] One Compiler: Deoptimization to Optimized Code
    Wimmer, Christian
    Jovanovic, Vojin
    Eckstein, Erik
    Wuerthinger, Thomas
    CC'17: PROCEEDINGS OF THE 26TH INTERNATIONAL CONFERENCE ON COMPILER CONSTRUCTION, 2017, : 55 - 64
  • [44] Code size reduction by compiler tuning
    Haneda, Masayo
    Knijnenburg, Peter M. W.
    Wijshoff, Harry A. G.
    EMBEDDED COMPUTER SYSTEMS: ARCHITECTURES, MODELING, AND SIMULATION, PROCEEDINGS, 2006, 4017 : 186 - 195
  • [45] TRACO: SOURCE-TO-SOURCE PARALLELIZING COMPILER
    Palkowski, Marek
    Bielecki, Wlodzimierz
    COMPUTING AND INFORMATICS, 2016, 35 (06) : 1277 - 1306
  • [46] A Source-to-Source OpenACC Compiler for CUDA
    Tabuchi, Akihiro
    Nakao, Masahiro
    Sato, Mitsuhisa
    EURO-PAR 2013: PARALLEL PROCESSING WORKSHOPS, 2014, 8374 : 178 - 187
  • [47] Source Code Analysis and Manipulation - Introduction
    Binkley, D
    Burd, L
    Harman, M
    Tonella, P
    SOFTWARE QUALITY JOURNAL, 2004, 12 (04) : 293 - 295
  • [48] Visual Analysis of Source Code Similarities
    Burch, Michael
    Strotzer, Julian
    Weiskopf, Daniel
    2015 19TH INTERNATIONAL CONFERENCE ON INFORMATION VISUALISATION IV 2015, 2015, : 21 - 27
  • [49] An extensible system for source code analysis
    Canfora, G
    Cimitile, A
    De Carlini, U
    De Lucia, A
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1998, 24 (09) : 721 - 740
  • [50] PyLocky Ransomware Source Code Analysis
    Sorini, Adam
    Scott, Gavin D.
    2020 IEEE SYMPOSIUM ON PRODUCT COMPLIANCE ENGINEERING (IEEE SPCE 2020), 2020,