[go: nahoru, domu]

Skip to content

hanquanjushi/SVF-Test

 
 

Repository files navigation

News

配置gllvm:

sudo apt install golang-go

go install github.com/SRI-CSL/gllvm/cmd/...@latest

nano ~/.bashrc

export PATH=$PATH:$(go env GOPATH)/bin

使用gllvm :

cmake -DCMAKE_C_COMPILER=gclang -DCMAKE_CXX_COMPILER=gclang++ -DCMAKE_BUILD_TYPE=Debug ..

make

get-bc program

llvm-dis program.bc -o program.ll

2024.5.8

目前已经实现:

1.if、else、while、for语句处理

2.#include read经过修正为__builtin__read后可以识别,但fread不适用此方法

3.给定函数llvm function 指针 找到他的绝对路径

4.函数的def和decl都在头文件 能不能找到头文件绝对路径

如果只有声明在头文件,定义在c文件,能不能找到声明的绝对路径

5.如果只给头文件,能不能用clang的api parse成ast

6.如果一个头文件/.c只是语法正确,但不能编译a=b,a没有声明,得到ast

待完成

1.将文件夹下所有.c和.h文件转换成string oracleText,对应workText,并对每个文件维护一个lineOffsetMap记录源文件哪一行对应oracleText的哪一行

2.实现 void deleteEitherBranch(const SVFValue* branchInst, bool condValue); void deleteBranch(const SVFValue* branchInst);
void deleteLoop(const SVFValue* inst); void deleteStmt(const SVFValue* inst);

3.实现
void addNewCodeSnippet(std::string sourcepath, const SVFValue* startInst, const SVFValue* endInst, std::string str);

void addNewCodeSnippetAfter(std::string sourcepath,
                            const SVFValue* startInst, std::string str);

void addNewCodeSnippetBefore(std::string sourcepath,
                             const SVFValue* endInst, std::string str);

Documentation

SVF is a static value-flow analysis tool for LLVM-based languages. SVF (CC'16) is able to perform

  • WPA (whole program analysis): field-sensitive (SAS'19), flow-sensitive (CGO'21, OOPSLA'21) analysis;
  • DDA (demand-driven analysis): flow-sensitive, context-sensitive points-to analysis (FSE'16, TSE'18);
  • MSSA (memory SSA form construction): memory regions, side-effects, SSA form (JSS'18);
  • SABER (memory error checking): memory leaks and double-frees (ISSTA'12, TSE'14, ICSE'18);
  • MTA (analysis of multithreaded programs): value-flows for multithreaded programs (CGO'16);
  • CFL (context-free-reachability analysis): standard CFL solver, graph and grammar (OOPSLA'22, PLDI'23);
  • SVFIR and MemoryModel (SVFIR): SVFIR, memory abstraction and points-to data structure (SAS'21);
  • Graphs: generating a variety of graphs, including call graph, ICFG, class hierarchy graph, constraint graph, value-flow graph for static analyses and code embedding (OOPSLA'20, TOSEM'21)

SVF's doxygen document is available here.


About SVF Setup Guide User Guide Developer Guide
About Setup User Developer
Introducing SVF -- what it does and how we design it A step by step setup guide to build SVF Command-line options to run SVF, get analysis outputs, and test SVF with an example or PTABen Detailed technical documentation and how to write your own analyses in SVF or use SVF as a lib for your tool

We are looking for self-motivated PhD students and welcome industry collaboration to improve SVF (Please contact y.sui@unsw.edu.au)


We release SVF source code in the hope of benefiting others. You are kindly asked to acknowledge usage of the tool by citing some of our publications listed http://svf-tools.github.io/SVF, especially the following two:

@inproceedings{sui2016svf,
  title={SVF: interprocedural static value-flow analysis in LLVM},
  author={Sui, Yulei and Xue, Jingling},
  booktitle={Proceedings of the 25th international conference on compiler construction},
  pages={265--266},
  year={2016},
  organization={ACM}
}
@article{sui2014detecting,
  title={Detecting memory leaks statically with full-sparse value-flow analysis},
  author={Sui, Yulei and Ye, Ding and Xue, Jingling},
  journal={IEEE Transactions on Software Engineering},
  volume={40},
  number={2},
  pages={107--122},
  year={2014},
  publisher={IEEE}
}

About

Static Value-Flow Analysis Framework for Source Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 82.6%
  • C 13.8%
  • HTML 2.7%
  • CMake 0.4%
  • Shell 0.2%
  • Perl 0.2%
  • Other 0.1%