static code analysis & debuggers

Jan 28, 2013 at 10:25am
Any recommendations of good programs which can do either or both of the above?

Free is good, but not mandatory.
Jan 28, 2013 at 3:53pm
the gnu debugger gdb. works greate for linux. i dont know what to use on windows. i think ida pro is quite good, but i dont have much experience with this.
Jan 28, 2013 at 5:55pm
Coverity is rather good as far as static analyzers go.
Jan 28, 2013 at 7:43pm
closed account (D4S8vCM9)
First of all, all is free software. Here is a list of tools I use for that purposes:

* Static Code analysis:
- cppcheck, there is nothing better!!!!
- the less known G++ option switch: -Weffc++

* Debugging:
- gdb with ddd as frontend
- valgrind (includes a lot of tools for all kinds of memory checks and a fantastic profiler)
- zzuf to fuzzy test and detect this way bugs, which would stay long unrecognized

* Metrics:
- cxxmetrics if you just need to check quickly basic metrics like LOC, Comment/code ratio, etc. (part of the KDEsdk subpackage, but a command line tool)
- CCCC for full metrics

That tools cover almost all topics aside from developing and I could not live without them.
Jan 28, 2013 at 10:54pm
One of the main purposes of Clang is to double as a compiler and a static code analyzer.

About Valgrind, you should be aware that it's only available on Linux. If Linux is not your main development platform, that's one good reason to always keep a) a Linux installation at hand, and b) your code as portable as possible, so it can be easily ported to Linux.
Jan 29, 2013 at 12:05am
Thanks for the advice everyone, much appreciated.
Jan 30, 2013 at 8:28pm
closed account (D4S8vCM9)
@helios: About Valgrind: maybe soon there will be a Windows version: http://sourceforge.net/p/valgrind4win/wiki/Home/

Otherwise my main development OS is Linux and I try to keep my projects portable to Windows :-D
Topic archived. No new replies allowed.