3

I'm looking for something like cflow but for C++.

ctags helps us find the definition. I want to find the callers, which is the reverse problem.

  • I don't have an answer (and I did not know about cflow actually), but - it seems that tools like exuberant ctags and the IDE provisioning of invocation-to-definition in C++ are somewhat similar in functionality to what you're asking for. – einpoklum Apr 19 '16 at 22:40
  • 1
    @einpoklum, ctags helps us find the definition. I want to find the callers, which is the reverse problem. – merlin2011 Apr 19 '16 at 22:41
  • We will need much more information to give good recommendations here – asking for "a tool like X" is never giving enough details, even if linked. You should always list your requirements explicitly. Please see How to ask for an alternative to some software and the questions linked to it for details. What are your requirements? How much money are you willing to spend (or must it be free)? – Izzy Apr 19 '16 at 22:49
1

Doxygen, which can be invoked from the command line once you have produced a doxyfile, can produce caller graph for all, or selected, functions/methods, in a given code project but these are normally viewed in a browser. You will also need the GraphViz DOT tool.

  • Free
  • Cross Platform
  • C++ and several other languages
  • How does Doxygen handle indirect function pointers, or virtual methods? – Ira Baxter Apr 20 '16 at 22:50
  • @IraBaxter - I am reasonably sure that Doxygen will handle virtual methods. It also should pick up simple uses of function pointers, e.g. if you have a lookup table of functions to call depending on the current state I would expect it to work but if you are passing function/class pointers around and then calling them from elsewhere I would expect you to be out of luck. I would also hope that you would be looking to refactor. – Steve Barnes Apr 21 '16 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.