@websvf/create-analysis
v2.6.1
Published
A CLI to bootstrap my new projects
Downloads
5
Maintainers
Readme
WebSVF-backend
Description
This is a simple NodeJS CLI tool to easily install WebSVF and run it.
System Requirements - Pre-Requesites
Ubuntu 18.04
WebSVF-backend can only be used with Ubuntu 18.04 at the momemt. Due to updated user management in new versions of Ubuntu, the current application does not work properly right now. Support for Ubuntu 20.04 is coming soon.
NodeJS >=v10.0
To run the WebSVF-backend scripts, npm version greater than 10.0 is required.
LLVM and Clang
The LLVM and Clang compiler tools need to be installed and accessible from the terminal.
WLLVM
For compiling entire projects into a LLVM Bitcode (.bc) file for analysis.
Installation
Install the command-line tool globally on your system using npm, by running the following command:
sudo npm i -g @websvf/create-analysis
Usage
(Optional) Setup Additional Project Dependencies (LLVM, Clang, Python, WLLVM)
Skip this step if you already have the required dependencies.
sudo create-analysis --setup-env
1. Install SVF
sudo create-analysis -i
Options
-i
or --install
:
Installs SVF
2. Generate Analysis for LLVM Bitcode (.bc) file
Generate the bitcode file for your program or project then run the following command from the same directory as the .bc file or specify the directory of the .bc file.
create-analysis
Options
-d bc-file-directory
or --dir bc-file-directory
(Optional):
Where -d
or --dir
flags indicate that the user wants to provide a path for the directory/folder containing the LLVM Bitcode (.bc) files. The -d
flag is used cannot be left empty, it must be provided with a directory or the command will fail. If no -d
flag is specified then the path for the directory containg the .bc files is assumed to be the current working directory from the terminal.
How to compile a C project or program to LLVM Bitcode (.bc): Detecting memory leaks (Step 2)
3. Generate Analysis using Custom Backend
Generate the bitcode file for your program or project then run the following command from the same directory as the .bc file or specify the directory of the .bc file.
create-analysis --custom-backend path-to-backend-executable
Options
--custom-backend path-to-backend-executable
:
If you have developed a custom backend for detecting memory leaks using the SVF library and the SVF Example.
You can specify the path to that executable using the --custom-backend option so that your new backend is used for generating the Bug Report instead of the default SVF backend bundled with WebSVF.
-d bc-file-directory
or --dir bc-file-directory
(Optional):
Where -d
or --dir
flags indicate that the user wants to provide a path for the directory/folder containing the LLVM Bitcode (.bc) files. The -d
flag is used cannot be left empty, it must be provided with a directory or the command will fail. If no -d
flag is specified then the path for the directory containg the .bc files is assumed to be the current working directory from the terminal.
4. Uninstall SVF
sudo create-analysis -u
-u
or --uninstall
:
To uninstall SVF
(Optional) Install SVF, LLVM and Clang
If you want to install SVF, LLVM and Clang together, you can do so by running the following command:
sudo create-analysis --install-all
(Optional) Re-Install Latest SVF
If you want to re-install SVF installed by the sudo create-analysis --install
command, you can do so by running the following command:
sudo create-analysis --reinstall-svf
(Optional) Uninstall LLVM and Clang
If you want to reset the environment setup by the sudo create-analysis --setup-env
, you can do so by running the following command:
sudo create-analysis --reset-env
(Optional) Uninstall SVF, LLVM and Clang
If you want to SVF, LLVM and Clang altogether, you can do so by running the following command:
sudo create-analysis --uninstall-all