6

Is there an open source and (relatively) simple-to-use dynamic code analysis tool for C++ code?

Something like IBM Purify (memory corruption detection, memory leak detection, application performance profiling, etc.)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user181218
  • 1,655
  • 5
  • 28
  • 42

4 Answers4

6

The software that is widely used (on Linux at least) is Valgrind. It has a lot of sub tools used to do what you are looking for.

There is also KCacheGrind which is a GUI frontend to the profiling tool of Valgrind, AKA Cachegrind.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
neuro
  • 14,948
  • 3
  • 36
  • 59
  • This seems to be a great tool, but the only thing is that it appears to be limited to Linux platforms only. I'm writing code in a windows environment. Am I doomed? :O – user181218 Feb 09 '11 at 14:51
  • @user181218: sorry I have less experience on windows tools concerning this area. For basic memory corruption I've used ElectricFence a long time ago. Check for Duma as stated in @eddy pronk answer, it seems to be a fork that works on windows ...And yes of course you are doomed ;) – neuro Feb 09 '11 at 18:36
  • Valgrind is terrible tool, with a lot of false positives. – user6039980 Jul 12 '17 at 02:26
  • @user6039980: Yes it has. But you can suppress false positives with suppressions files. – neuro Jul 12 '17 at 08:29
2

Try Duma (Detect Unintended Memory Access).

AHelps
  • 1,782
  • 11
  • 17
Eddy Pronk
  • 6,527
  • 5
  • 33
  • 57
  • +1: I've used ElectricFence from which duma seems to have forked. Thanks for the link ... – neuro Feb 08 '11 at 17:25
1

Try Valgrind. It is not as powerful as IBM Purify, but it works quite fine...

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
vrbilgi
  • 5,703
  • 12
  • 44
  • 60
0

CodeCompass is quite good as well.

Although it has quite the dependencies compared to Valgrind and Duma, it's a quality analysis tool.

Dávid Tóth
  • 2,788
  • 1
  • 21
  • 46