Scitools Understand is a fantastic tool, better than everything I know for reverse engineering, and generates high quality graphs.I'm trying to generate a call graph using doxygen and graphiz. Scitools Understand is a fantastic tool, but quite expensive, better than everything I know for reverse engineering and generates high quality graphs.īut note that the trial version has its butterfly call graph limited to only one level of call (IMHO I believe they don't help themselves doing so…) SOLUTION 9 : SOLUTION 7 :ĭoxygen + graphviz could solve most problems when we wanna generate call graph,next handed to manpower. The "C++ Bsc Analyzer" can display call graphs - by reading the file generated by the bscmake utility. the full command should look as: clang++ -# -fsyntax-only -S -emit-llvm main1.cpp -o - | opt -analyze -dot-callgraph SOLUTION 6 : In order for the clang++ command to find standard header files like mpi.h two additional options should be used -# -fsyntax-only, i.e. You can use CppDepend, it can generates many kinds of graphs I am impressed by Schaub's answer, using Clang I would expect Clang to have all the elements right. I don't know what they use for a parser, or whether they do the detailed analysis right I have no specific experience with their product. Such profilers will show you the actual call graph exercised.ĮDIT: I suddenly remembered Understand for C++, which claims to construct call graphs. You might be better off running a timing profiler which collects a call graph dynamically (this describes ours) and simply exercise a lot of cases. Doxygen doesn't have any of these, I don't know why people claim to like it for C++ it is easy to construct a 10 line C++ example that Doxygen erroneously analyzes). Statically computing an accurate C++ call graph is hard, because you need a precise langauge parser, correct name lookup, and a good points-to analyzer that honors the language semantics properly. I did not manage to install it myself and that's why I tried to find an alternative solution! SOLUTION 3 : With Johannes Schaub - litb main.cpp, it generates this:ĭoxygen/dot are probably easier than clang/opt to install and run. You can achieve that by using doxygen (with option to use dot for graphs generation). That mystical unnamed function, Node0x884c4e0, is a placeholder assumed to be called by any function whose definition is not known. Yields this beauty (oh my, the size without optimizations turned on was too big!) Clients will always obtain the smart pointer object through a factory in order to invoke D.ĭoes anyone know how to achieve this? SOLUTION 1 : static void D() $1 != id' | dot -Tpng -ocallgraph.png In my case, D is a member function of a class whose object will be wrapped within a smart pointer. I have tried Codeviz and Doxygen, somehow both results show nothing but callees of target function, D. I'm trying to generate calling graph with which to find out all the possible execution paths that are hitting a particular function (so that I don't have to figure out all the paths manually, as there are many paths that lead to this function).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |