Search code examples
graphdoxygen

Create a call graph for a specific function using Doxygen


When I have EXTRACT_ALL, EXTRACT_PRIVATE AND EXTRACT_STATIC all set to YES, then I can create call graphs for almost all entities in my project. But how do I create a call graph for a specific function?

If it is possible, then if I enable INTERACTIVE_SVG, is it possible to access the functions in my call graph or do I have to create a call graph for each called function?


Solution

  • This is a bit depending on your version of doxygen. But besides the configuration settings (always needed HAVE_DOT=YES):

    • CALL_GRAPH
    • CALLER_GRAPH

    there are the commands (see https://www.doxygen.nl/manual/commands.html):

    • \callgraph
    • \callergraph
    • \hidecallgraph
    • hidecallergraph

    with these commands it should be possible to create the required graphs.

    Upon request:

    The doxygen configuration file

    HAVE_DOT=YES
    

    The source code file

    /// \file
    
    /// \brief the first function
    /// \details the details of the first function
    /// \callgraph
    void fie1(void)
    {
      fie2();
    };
    
    /// \brief the second function
    /// \details the details of the second function
    void fie2(void);