使用 Doxygen 为特定函数创建调用图

Create a call graph for a specific function using Doxygen

当我将 EXTRACT_ALL、EXTRACT_PRIVATE 和 EXTRACT_STATIC 全部设置为 YES 时,我就可以为项目中的几乎所有实体创建调用图。但是如何为特定函数创建调用图?

如果可能,那么如果我启用 INTERACTIVE_SVG,是否可以访问我的调用图中的函数,还是我必须为每个调用的函数创建一个调用图?

这有点取决于您的 doxygen 版本。 但除了配置设置(总是需要HAVE_DOT=YES):

  • CALL_GRAPH
  • CALLER_GRAPH

有命令(参见https://www.doxygen.nl/manual/commands.html):

  • \callgraph
  • \callergraph
  • \hidecallgraph
  • hidecallergraph

使用这些命令应该可以创建所需的图表。

根据要求:

doxygen 配置文件

HAVE_DOT=YES

源代码文件

/// \file

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

/// \brief the second fie
/// \details the details of the second fie
void fie2(void);