2.13 华为横向课题周会

一、程序的前向切片与后向切片

A forward slice identifies those statements that are affected by a particular statement.

前向切片识别那些特定语句影响的语句。

A backward slice identifies those statements that affect the computation of a particular statement.

后向切片识别那些影响特定语句计算的语句。

后向其实指的是倒退,即到之前的代码里找;前向其实指的是前进,即到还未执行的代码里找。

因此做影响域分析时,我们需要找程序的前向切片而非后向切片。

二、静态程序切片

2.1 dg

GitHub地址:mchalupa / dg

DG is a library containing various bits for program analysis. However, the main motivation of this library is program slicing. The library contains implementation of a pointer analysis, data dependence analysis, control dependence analysis, and an analysis of relations between values in LLVM bitcode. All of the analyses target LLVM bitcode, but most of them are written in a generic way, so they are not dependent on LLVM in particular.

Further, DG contains an implementation of dependence graphs and a static program slicer for LLVM bitcode. Some documentation can be found in the doc/ directory.

可参考的大致描述:DG: Analysis and Slicing of LLVM Bitcode
doc 目录下有较为详细的描述。

2.2 Symbiotic 框架

GitHub地址:staticafi / symbiotic

Symbiotic is an open-source framework for program analysis integrating instrumentation, static program slicing and various program analysis tools. Symbiotic is highly modular and most of its components are self-standing programs or LLVM passes that have their own repositories at https://github.com/staticafi.

它是一个开源框架,主要是集成各类技术,包括 LLVM,KLEE 等。
它有一系列文章,第一篇应该是:Symbiotic: Synergy of Instrumentation, Slicing, and Symbolic Execution (Competition Contribution)

三、动态程序切片

不考虑使用该方式,但可以了解一下用 Java 实现的动态切片工具 pmd

猜你喜欢

转载自blog.csdn.net/weixin_45651194/article/details/129019155