static code analysis & debuggers

Any recommendations of good programs which can do either or both of the above?

Free is good, but not mandatory.
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.
Coverity is rather good as far as static analyzers go.
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.
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.
Thanks for the advice everyone, much appreciated.
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.