首页 > 解决方案 > 使用 Doxygen 为特定函数创建调用图

问题描述

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

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

标签: graphdoxygen

解决方案


这有点取决于您的 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);

推荐阅读