CodeSurfer

Mark Zarins of GrammaTech writes about the CodeSurfer tool, which is freely available for academic researchers:

CodeSurfer is an advanced source-code analysis platform for C/C++ that understands pointers, indirect function calls, and whole-program effects. GrammaTech is pleased to offer CodeSurfer at no cost to qualified academic computer science researchers.

CodeSurfer builds a dependence-graph program representation and provides both a GUI and an API for exploring this web. The dependence graph includes forward and backward links between each assignment statement and possible uses of the values stored by that assignment (data flow). Pointer analysis is used so that indirect loads and stores through pointers are taken into account, as well as indirect function calls. Dataflow analysis is used so that links between unrelated assignments and uses are excluded. Operations that highlight forward and backward slices show the impact of a given statement on the rest of the program (forward slicing), and the impact of the rest of a program on a given statement (backward slicing). Operations that highlight paths between nodes in the dependence graph (chops) show ways in which the program points are interdependent (or independent).

CodeSurfer’s scripting language, which provides access to the dependence graph program representation, can be used to build batch program-analysis applications, or to integrate CodeSurfer with other tools. The following program representations are calculated:

  • Abstract Syntax Trees (ASTs) [with a pattern matching API]
  • Preprocessor Expansions and Include Trees
  • Points-To and Pointed-To-By Sets
  • Control Flow Graphs (CFGs)
  • Call Multi-Graphs [direct & indirect]
  • Def, Use, and Conditional-Kill Sets [per statement]
  • Non-Local Def and Use Sets [per procedure]
  • Control and Data Dependences (PDGs) [per statement]
  • Transitive in/out data dependences [per procedure]

More information about the programming API can be found here:
http://www.grammatech.com/products/codesurfer/overview_prog.html

More information about the CodeSurfer Academic Program can be found here:
http://www.grammatech.com/products/codesurfer/academic.html

Important notes: Under the academic program, use of CodeSurfer is limited to non-profit use within academic units only. In addition, although you may use CodeSurfer to implement source-to-source transformations, you may not use it to implement a compiler, i.e., a direct translation to machine code.

2 Responses to “CodeSurfer”

  1. Samson Says:

    And I liked, will be looking at your site.

  2. Machelle Zamora Says:

    279xzb0j1l11678m

Leave a Reply