Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic slicing in C/C++

After reading the book of debugging from Andreas Zeller, I became interested in Dynamic Slicing.

At the moment I only found relevant tools for Java analysis. Do you know such tools for C/C++?

like image 590
Open the way Avatar asked Sep 15 '09 18:09

Open the way


2 Answers

A little information in addition to Rob's

  • the Wisconsin Program-Slicing Tool has evolved in a tool called CodeSurfer. Good news: it's commercially available and supported, and it works great for what it does. Bad news (perhaps): it does not actually produce a reduced program that computes the same value that you selected, but it's very convenient for navigating source code that you have not written.

  • Frama-C handles only C (no C++ for the foreseeable future). It is nice, not great, for navigating source code, but it can produce an equivalent smaller program for the criterion that you specify, if the original program is of the kind that it can analyze automatically (no recursion, no dynamic allocation). Frama-C is Open Source and has a mailing list in which your questions will be welcome if you are interested in the techniques it uses.

The reason CodeSurfer does not risk itself to produce an equivalent program and Frama-C can only do it for code with embedded-like restrictions is, in short, that doing so requires knowing the values of pointers, which can be arbitrarily difficult to compute with precision.

like image 71
Pascal Cuoq Avatar answered Sep 28 '22 07:09

Pascal Cuoq


There's a tool listed on the Wikipedia page you cite. It's for C, so I guess it could work for whatever "C/C++" is.

  • Wisconsin Program-Slicing Tool

Also for C, and also mentioned on the Wikipedia page:

  • Frama-C
like image 43
Rob Kennedy Avatar answered Sep 28 '22 08:09

Rob Kennedy