PDA

View Full Version : A few interesting tools...



Mad_guy
03-07-2009, 03:18 PM
Recently I've been scavenging around and I've found some interesting tools I'd like to share. :]

Coccinelle (http://www.emn.fr/x-info/coccinelle/) - a 'semantic patch' based framework - you can think of it like a super-uber-enhanced version of GNU patch. The primary motivation AFAICS, as seen on the page, is semantic patching of e.g. Linux drivers. You'll really just have to go to the webpage and see an example/read a little to get an idea of how it works because I can't explain it too well, but it's an amazingly innovative and cool idea.

Frama-C (http://frama-c.cea.fr) - a framework for C source code analysis; has a lot of really interesting tools, the two catching my eye the most being:

* Jessie/ACSL (http://frama-c.cea.fr/acsl.html) - A plugin for formally proving properties about your programs.
* Slicing (http://frama-c.cea.fr/slicing.html) - a plugin allowing you to...

... produce an output program which is made of a subset of the statements of the analyzed program, in the same order as in the analyzed program. The statements are selected according to a user-provided slicing criterion. The output program is guaranteed to be compilable C code, and to have the same behavior as the analyzed program from the point of view of the provided slicing criterion.

On the note of ACSL, you may also find Deputy (http://deputy.cs.berkeley.edu/) interesting; it's a C compiler (gcc-compatible) that allows you to annotate your programs for safety measures. Apparently Linux drivers etc. were also a motivation for this project. I might as well also throw the Clang static analyzer (http://clang.llvm.org/StaticAnalysis.html) out there; it has the advantage it can check C and objective-C programs (and once support gets better, C++ as well hopefully.) If you also don't know about clang/llvm, then you should educate (http://llvm.org) yourself (http://clang.llvm.org) because they are both awesome (I hope clang is the death of GCC, personally.)

Also, for large code bases (I'm talking in the 10-20 million line range, like linux or something,) you would be a fool not to have cscope (http://cscope.sf.net) (I've known about/used cscope for years; I mention it because it does not get enough love!)

Currently I'm writing a garbage collector in C, and I think ACSL and/or deputy could help out a lot hopefully...

Does anybody else have any interesting tools they've recently found and would like to share?

laserlight
03-07-2009, 03:31 PM
Coincidentally, I just found out about slicing today when I saw a poster on JSlice (http://jslice.sourceforge.net). Apparently the tool was developed by students from my faculty, so the university happily tried to advertise that fact to other students.

CornedBee
03-08-2009, 04:18 AM
I might as well also throw the Clang static analyzer (http://clang.llvm.org/StaticAnalysis.html) out there; it has the advantage it can check C and objective-C programs (and once support gets better, C++ as well hopefully.) If you also don't know about clang/llvm, then you should educate (http://llvm.org) yourself (http://clang.llvm.org) because they are both awesome (I hope clang is the death of GCC, personally.)


Why, thank you! :)

brewbuck
03-08-2009, 01:21 PM
Why, thank you! :)

Did you work on this project?

CornedBee
03-08-2009, 02:25 PM
I'm actively working on it, yeah. Mostly the C++ parser.

Mad_guy
03-10-2009, 06:07 PM
I'm actively working on it, yeah. Mostly the C++ parser.

Neato! There's a lot of effort being poured into both llvm and clang right now; it's a very active and well designed project, and I think with some time, clang could easily become the gcc killer (and as I said, I kind of hope it does.) Kudos to you for working on good software like this! (I would contribute to clang, but I'm already actively working on another compiler at the moment, and my C++ isn't so awesome.)