Do you have any sugestions of tools to ease the task of understanding C/C++ code? We just inherited a large piece of software written by others and we need to quickly get up to speed on it. Any advice on tools that might simplify this task?
相关问题
- Sorting 3 numbers without branching [closed]
- Multiple sockets for clients to connect to
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
SourceInsight and Understand for C++ are the best tools you can get for c/c++ code analysis including flow charts.
I used Borland Together a while back and it did a decent job of generating models from code. I believe it will even generate sequence diagrams from code. Keep in mind if your code is a mess your model will be too. And as I recall it isn't cheap but sometimes you can catch a special.
Doxygen is very good at generating diagrams from code without applying markup, if you turn on the EXTRACT_ALL option. You need GraphViz installed to get diagrams generated with the HAVE_DOT setting. I find having it installed and leaving the DOT_PATH blank works fine on Windows but on OS/X keep having to point directly to the dot tool location.
There's an excellent Code Spelunking article in ACM Queue which talks more about using doxygen and DTrace.
Doxygen, the good thing about it is it will let you know hoe ugly/good is your code in terms of cyclic dependency of classes. So you will be forced to re-factor your code, though you may not like it :-)