用于生成 C++ 代码轮廓/地图的工具 - 有这样的东西吗? [英] tool for generating an outline/map of a C++ code - is there such thing?

查看:58
本文介绍了用于生成 C++ 代码轮廓/地图的工具 - 有这样的东西吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要对用 C++ 编写的软件组件进行一些修改.我幻想着生成一些代码映射,这将显示类之间的关系并引导我完成方法的流程/调用图.有没有这方面的工具?

I need to get into and make some modifications to a software component written in C++. I am fantasizing about generating some map of the code, that would show relationships between classes and walk me through the flow / call graph of methods. Is there a tool for this?

多年前,我使用 Rational Rose 建模工具,该工具具有对代码进行逆向工程并为其构建类图的功能.然而,对于此类项目探索重要的是一些动态信息,如序列图(理想情况下)或调用图.更不用说 Rose 对于这样一项临时任务来说太大了,实际上我根本不知道它是否存在.

Years ago I worked with Rational Rose modeling tool with had a feature of reverse-engineering the code and building a class diagram for it. However what's important for such project exploration is also some dynamic information like sequence diagram (ideally) or call graph. Not mentioning that Rose is too big for such one off task and actually I don't know if it exists at all still.

推荐答案

我个人使用 Doxygen https://github.com/doxygen/doxygen 并且它确实是最容易配置的程序之一,可以使输出如您所描述的那样.

I personally use Doxygen https://github.com/doxygen/doxygen and its truly among the easiest program to configure in a way that makes output like what you describe.

要生成调用图,您还需要可以在 graphviz 中获得的点 http://www.graphviz.org/.可能还有一些其他依赖项,但在这些情况下,它应该在配置文件中说明,顺便说一下,该文件已得到很好的注释.

To generate call graphs you would also need dot which you can get in graphviz http://www.graphviz.org/. There might be some other dependency's but in those cases it should say so in the configuration file which by the way is rather well commented.

Doxygen 的配置文件起初可能看起来很庞大,但最终结果是值得的.

The configuration file of Doxygen might seem extensive at first, but the end result is worth it.

这篇关于用于生成 C++ 代码轮廓/地图的工具 - 有这样的东西吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆