Zelda - Zee Exception Length and Destination Analyzer
June 4, 2019 ยท View on GitHub
This readme contains information about Zelda, as well as setup and usage details.
What is Zelda?
Zelda is a C++ exception static analsis tool that uses LLVM Tooling to extrace details about exceptions from C++ source code and determine the flow of exceptions through the code base.
The model generated by Zelda is encoded in the Tuple-Attribute (TA) format. This format was developed by Ric Holt at the University of Waterloo and is discussed in this paper. The TA format contains entities, their relationships, and attributes that describe these entities and relationships. This program model can be queried using relational algebra.
While Zelda is developed to extract a program model, users must download additional tools from the Sofware Architecture Group (SWAG) at the Univesity of Waterloo to perform queries. This guide wil cover how these tools are configured in the "setup" section.
Features of Zelda
Currently, Zelda supports the following:
-
Determine presence and location of exception statements.
-
Determine exception flow.
-
Simple classification of catch-block statements.
-
C++ language support including
C++11andC++14.
Installation Details
Prerequisties
Zelda requires at least Clang 5.0.0 and requires CMake 3.0.0 or greater to run. Additionally, to build Zelda, Boost libraries are required. For Boost, the computer building Zelda requires Boost version 1.6 or greater. Additionally, other libraries are required that will be defined in their own section below. If you meet any of these prerequisites, feel free to skip their associated section below.
Installing CMake
First, CMake should be installed. On Linux, this is as simple as running:
$ sudo apt-get install cmake
This will install the most current version of CMake based on your sources list. Be sure to check the version to ensure you have a version of CMake greater than 3.0.0. This can be done by running:
$ cmake --version
If you want the most current version of CMake, this will require a bit of additional work. First, download the most recent version from the CMake website and download the Linux source version. The commands below show how CMake is installed from the 3.7.0 Linux source version. Change the version label in the download link to download a different version.
First, we download and unzip the source files:
$ wget https://cmake.org/files/v3.7/cmake-3.7.0.tar.gz
$ tar xvzf cmake-3.7.0.tar.gz
$ cd cmake-3.7.0.tar.gz
Special Thanks
Zelda used Rex, developed by Bryan J Muscedere, as an example of how to work with LLVM Tooling. The driver, graph, and parent walker are primarily the code from Rex and has been updated to reflect the needs of Zelda. Thank you to Bryan for the use of his code and assistance with installing and understanding Rex.