1

I'm trying to find if functionX is ever called by functionY by way of any other number of functions (let's call them functionA, functionB, and functionC) in a large codebase that fortunately does not make excessive use of callback functions.

I'm clicking through doxygen include-dependency-graphs manually (read inefficiently). How can I search more effectively? Can ag save me?

Example call graph:

enter image description here

taken from: https://codeyarns.com/2013/12/24/how-to-create-header-include-graph-using-doxygen/

tarabyte
  • 17,837
  • 15
  • 76
  • 117
  • When trying to show an image, include the image as people don't like to click on unknown links and external references might get lost over time. – albert Dec 12 '16 at 17:39
  • Did you have a look at the configuration options CALL_GRAPH and CALLER_GRAPH? – albert Dec 12 '16 at 17:41
  • @albert, updated. – tarabyte Dec 12 '16 at 18:01
  • also `CALL_GRAPH`, `CALLER_GRAPH` and all dependent options are enabled and working. this just takes way too long to manually sift through and those also have limited available as private functions are included – tarabyte Dec 12 '16 at 18:08
  • It is not easy to follow all those path especially when everything is deeply nested. I assume that you have set MAX_DOT_GRAPH_DEPTH to a reasonable level for your purpose so that you can see multiple levels of function calls (pointer to function and callback function make these tasks indeed harder to find). – albert Dec 12 '16 at 18:33
  • `DOT_GRAPH_MAX_NODES = 50` and `MAX_DOT_GRAPH_DEPTH = 0` (no restriction). I think I'm looking for something more like gnu global. – tarabyte Dec 12 '16 at 18:45
  • 1
    if you mean that you don't want to look at visualizations of the call graph, but want to search it with ag/grep/etc. Have you considered egypt: http://www.gson.org/egypt/? This perl program will generate a text based call graph that you could then search with ag. – gregory Jan 10 '17 at 19:57

1 Answers1

0
  1. Change DOT_CLEANUP = NO in your configuration and run Doxygen again
  2. Find the call graph dot file for functionX (will have a similar name as to the image generated, but with a .dot extension)
  3. Search that dot file for functionY.

You can equally search for functionX in the caller graph .dot file of functionY.

BTW, you didn't post a call graph image; you posted an include tree. I assume that was that a mistake, and that you do have CALL_GRAPH=yes (and/or CALLER_GRAPH=yes).

Michael
  • 2,118
  • 1
  • 19
  • 25